From 3b4c614b7f46bba83fac0b2102880c471e1920eb Mon Sep 17 00:00:00 2001 From: Jay Sim Date: Fri, 8 Sep 2017 17:34:23 +1000 Subject: [PATCH 1/5] create class library that targets .net library create uwp sample project (but no test cases yet) --- SubtitlesParser.sln | 241 +- .../Classes/Parsers/YtXmlFormatParser.cs | 65 - SubtitlesParser/SubtitlesParser.csproj | 112 - SubtitlesParser/SubtitlesParser.nuspec | 16 - .../Classes/Parsers/ISubtitlesParser.cs | 2 +- .../Classes/Parsers/MicroDvdParser.cs | 4 +- .../Classes/Parsers/SrtParser.cs | 378 +- .../Classes/Parsers/SsaParser.cs | 2 +- .../Classes/Parsers/SubParser.cs | 3 +- .../Classes/Parsers/SubViewerParser.cs | 2 +- .../Classes/Parsers/TtmlParser.cs | 4 +- .../Classes/Parsers/VttParser.cs | 416 +- .../Classes/StreamHelpers.cs | 2 +- .../Classes/SubtitleItem.cs | 2 +- .../Classes/SubtitlesFormat.cs | 140 +- SubtitlesParserNew/SubtitlesParserNew.csproj | 7 + SubtitlesParserTest.Portable/App.xaml | 10 + SubtitlesParserTest.Portable/App.xaml.cs | 29 + SubtitlesParserTest.Portable/MainPage.xaml | 14 + SubtitlesParserTest.Portable/MainPage.xaml.cs | 26 + .../SubtitlesParserTest.Portable.csproj | 34 + .../Assets/AboutAssets.txt | 19 + .../MainActivity.cs | 23 + .../Properties/AndroidManifest.xml | 5 + .../Properties/AssemblyInfo.cs | 34 + .../Resources/AboutResources.txt | 50 + .../Resources/Resource.Designer.cs | 5936 ++++ .../Resources/drawable-hdpi/icon.png | Bin 0 -> 1431 bytes .../Resources/drawable-xhdpi/icon.png | Bin 0 -> 1789 bytes .../Resources/drawable-xxhdpi/icon.png | Bin 0 -> 2353 bytes .../Resources/drawable/icon.png | Bin 0 -> 1431 bytes .../Resources/layout/Tabbar.axml | 11 + .../Resources/layout/Toolbar.axml | 9 + .../Resources/values/styles.xml | 30 + .../SubtitlesParserTest.Android.csproj | 140 + .../packages.config | 12 + .../SubtitlesParserTest.UWP/App.xaml | 8 + .../SubtitlesParserTest.UWP/App.xaml.cs | 97 + .../Assets/LockScreenLogo.scale-100.png | Bin 0 -> 261 bytes .../Assets/LockScreenLogo.scale-125.png | Bin 0 -> 305 bytes .../Assets/LockScreenLogo.scale-150.png | Bin 0 -> 347 bytes .../Assets/LockScreenLogo.scale-200.png | Bin 0 -> 431 bytes .../Assets/LockScreenLogo.scale-400.png | Bin 0 -> 758 bytes .../Assets/SplashScreen.scale-100.png | Bin 0 -> 1706 bytes .../Assets/SplashScreen.scale-125.png | Bin 0 -> 2148 bytes .../Assets/SplashScreen.scale-150.png | Bin 0 -> 2609 bytes .../Assets/SplashScreen.scale-200.png | Bin 0 -> 3566 bytes .../Assets/SplashScreen.scale-400.png | Bin 0 -> 8784 bytes .../Assets/Square150x150Logo.scale-100.png | Bin 0 -> 1019 bytes .../Assets/Square150x150Logo.scale-125.png | Bin 0 -> 1288 bytes .../Assets/Square150x150Logo.scale-150.png | Bin 0 -> 1484 bytes .../Assets/Square150x150Logo.scale-200.png | Bin 0 -> 1948 bytes .../Assets/Square150x150Logo.scale-400.png | Bin 0 -> 3734 bytes .../Assets/Square44x44Logo.scale-100.png | Bin 0 -> 394 bytes .../Assets/Square44x44Logo.scale-125.png | Bin 0 -> 483 bytes .../Assets/Square44x44Logo.scale-150.png | Bin 0 -> 563 bytes .../Assets/Square44x44Logo.scale-200.png | Bin 0 -> 658 bytes .../Assets/Square44x44Logo.scale-400.png | Bin 0 -> 1152 bytes ...x44Logo.targetsize-16_altform-unplated.png | Bin 0 -> 196 bytes ...x44Logo.targetsize-24_altform-unplated.png | Bin 0 -> 253 bytes ...44Logo.targetsize-256_altform-unplated.png | Bin 0 -> 1656 bytes ...x44Logo.targetsize-32_altform-unplated.png | Bin 0 -> 314 bytes ...x44Logo.targetsize-48_altform-unplated.png | Bin 0 -> 422 bytes .../Assets/StoreLogo.png | Bin 0 -> 392 bytes .../Assets/Wide310x150Logo.scale-100.png | Bin 0 -> 921 bytes .../Assets/Wide310x150Logo.scale-125.png | Bin 0 -> 1149 bytes .../Assets/Wide310x150Logo.scale-150.png | Bin 0 -> 1369 bytes .../Assets/Wide310x150Logo.scale-200.png | Bin 0 -> 1719 bytes .../Assets/Wide310x150Logo.scale-400.png | Bin 0 -> 3682 bytes .../SubtitlesParserTest.UWP/MainPage.xaml | 15 + .../SubtitlesParserTest.UWP/MainPage.xaml.cs | 27 + .../Package.appxmanifest | 49 + .../Properties/AssemblyInfo.cs | 29 + .../Properties/Default.rd.xml | 31 + .../SubtitlesParserTest.UWP.csproj | 164 + .../SubtitlesParserTest.UWP.nuget.props | 18 + .../SubtitlesParserTest.UWP.nuget.targets | 9 + .../SubtitlesParserTest.UWP_TemporaryKey.pfx | Bin 0 -> 2450 bytes .../SubtitlesParserTest.UWP/project.json | 17 + .../SubtitlesParserTest.UWP/project.lock.json | 23713 ++++++++++++++++ .../SubtitlesParserTest.iOS/AppDelegate.cs | 31 + .../Entitlements.plist | 7 + .../SubtitlesParserTest.iOS/Info.plist | 52 + .../SubtitlesParserTest.iOS/Main.cs | 20 + .../Properties/AssemblyInfo.cs | 72 +- .../Resources/Default-568h@2x.png | Bin 0 -> 8884 bytes .../Resources/Default-Portrait.png | Bin 0 -> 10710 bytes .../Resources/Default-Portrait@2x.png | Bin 0 -> 34540 bytes .../Resources/Default.png | Bin 0 -> 7243 bytes .../Resources/Default@2x.png | Bin 0 -> 8368 bytes .../Resources/Icon-60@2x.png | Bin 0 -> 1712 bytes .../Resources/Icon-60@3x.png | Bin 0 -> 21641 bytes .../Resources/Icon-76.png | Bin 0 -> 1200 bytes .../Resources/Icon-76@2x.png | Bin 0 -> 2262 bytes .../Resources/Icon-Small-40.png | Bin 0 -> 729 bytes .../Resources/Icon-Small-40@2x.png | Bin 0 -> 1245 bytes .../Resources/Icon-Small-40@3x.png | Bin 0 -> 12610 bytes .../Resources/Icon-Small.png | Bin 0 -> 1144 bytes .../Resources/Icon-Small@2x.png | Bin 0 -> 955 bytes .../Resources/Icon-Small@3x.png | Bin 0 -> 7309 bytes .../Resources/LaunchScreen.storyboard | 39 + .../SubtitlesParserTest.iOS.csproj | 152 + .../SubtitlesParserTest.iOS/iTunesArtwork | Bin 0 -> 16867 bytes .../SubtitlesParserTest.iOS/iTunesArtwork@2x | Bin 0 -> 20666 bytes .../SubtitlesParserTest.iOS/packages.config | 4 + .../Assets/AboutAssets.txt | 19 + .../MainActivity.cs | 27 + .../Properties/AndroidManifest.xml | 5 + .../Properties/AssemblyInfo.cs | 34 + .../Resources/AboutResources.txt | 50 + .../Resources/Resource.Designer.cs | 73 + .../Resources/drawable-hdpi/icon.png | Bin 0 -> 1431 bytes .../Resources/drawable-xhdpi/icon.png | Bin 0 -> 1789 bytes .../Resources/drawable-xxhdpi/icon.png | Bin 0 -> 2353 bytes .../Resources/drawable/icon.png | Bin 0 -> 1431 bytes .../Resources/layout/Tabbar.axml | 11 + .../Resources/layout/Toolbar.axml | 9 + .../Resources/values/styles.xml | 30 + .../SubtitlesParserXamarinTest.Android.csproj | 132 + .../packages.config | 12 + .../2518_aud_SpReco.ttml | 23 + .../2518_aud_SpReco.vtt | 10 + .../SubtitlesParserXamarinTest.UWP/App.xaml | 8 + .../App.xaml.cs | 107 + .../Assets/LockScreenLogo.scale-100.png | Bin 0 -> 261 bytes .../Assets/LockScreenLogo.scale-125.png | Bin 0 -> 305 bytes .../Assets/LockScreenLogo.scale-150.png | Bin 0 -> 347 bytes .../Assets/LockScreenLogo.scale-200.png | Bin 0 -> 431 bytes .../Assets/LockScreenLogo.scale-400.png | Bin 0 -> 758 bytes .../Assets/SplashScreen.scale-100.png | Bin 0 -> 1706 bytes .../Assets/SplashScreen.scale-125.png | Bin 0 -> 2148 bytes .../Assets/SplashScreen.scale-150.png | Bin 0 -> 2609 bytes .../Assets/SplashScreen.scale-200.png | Bin 0 -> 3566 bytes .../Assets/SplashScreen.scale-400.png | Bin 0 -> 8784 bytes .../Assets/Square150x150Logo.scale-100.png | Bin 0 -> 1019 bytes .../Assets/Square150x150Logo.scale-125.png | Bin 0 -> 1288 bytes .../Assets/Square150x150Logo.scale-150.png | Bin 0 -> 1484 bytes .../Assets/Square150x150Logo.scale-200.png | Bin 0 -> 1948 bytes .../Assets/Square150x150Logo.scale-400.png | Bin 0 -> 3734 bytes .../Assets/Square44x44Logo.scale-100.png | Bin 0 -> 394 bytes .../Assets/Square44x44Logo.scale-125.png | Bin 0 -> 483 bytes .../Assets/Square44x44Logo.scale-150.png | Bin 0 -> 563 bytes .../Assets/Square44x44Logo.scale-200.png | Bin 0 -> 658 bytes .../Assets/Square44x44Logo.scale-400.png | Bin 0 -> 1152 bytes ...x44Logo.targetsize-16_altform-unplated.png | Bin 0 -> 196 bytes ...x44Logo.targetsize-24_altform-unplated.png | Bin 0 -> 253 bytes ...44Logo.targetsize-256_altform-unplated.png | Bin 0 -> 1656 bytes ...x44Logo.targetsize-32_altform-unplated.png | Bin 0 -> 314 bytes ...x44Logo.targetsize-48_altform-unplated.png | Bin 0 -> 422 bytes .../Assets/StoreLogo.png | Bin 0 -> 392 bytes .../Assets/Wide310x150Logo.scale-100.png | Bin 0 -> 921 bytes .../Assets/Wide310x150Logo.scale-125.png | Bin 0 -> 1149 bytes .../Assets/Wide310x150Logo.scale-150.png | Bin 0 -> 1369 bytes .../Assets/Wide310x150Logo.scale-200.png | Bin 0 -> 1719 bytes .../Assets/Wide310x150Logo.scale-400.png | Bin 0 -> 3682 bytes .../MainPage.xaml | 15 + .../MainPage.xaml.cs | 27 + .../Package.appxmanifest | 49 + .../Properties/AssemblyInfo.cs | 29 + .../Properties/Default.rd.xml | 31 + .../SubtitlesParserXamarinTest.UWP.csproj | 160 + ...btitlesParserXamarinTest.UWP.nuget.targets | 18 + ...tlesParserXamarinTest.UWP_TemporaryKey.pfx | Bin 0 -> 2450 bytes .../project.json | 17 + .../project.lock.json | 22319 +++++++++++++++ .../AppDelegate.cs | 31 + .../Entitlements.plist | 7 + .../SubtitlesParserXamarinTest.iOS/Info.plist | 52 + .../SubtitlesParserXamarinTest.iOS/Main.cs | 20 + .../Properties/AssemblyInfo.cs | 36 + .../Resources/Default-568h@2x.png | Bin 0 -> 8884 bytes .../Resources/Default-Portrait.png | Bin 0 -> 10710 bytes .../Resources/Default-Portrait@2x.png | Bin 0 -> 34540 bytes .../Resources/Default.png | Bin 0 -> 7243 bytes .../Resources/Default@2x.png | Bin 0 -> 8368 bytes .../Resources/Icon-60@2x.png | Bin 0 -> 1712 bytes .../Resources/Icon-60@3x.png | Bin 0 -> 21641 bytes .../Resources/Icon-76.png | Bin 0 -> 1200 bytes .../Resources/Icon-76@2x.png | Bin 0 -> 2262 bytes .../Resources/Icon-Small-40.png | Bin 0 -> 729 bytes .../Resources/Icon-Small-40@2x.png | Bin 0 -> 1245 bytes .../Resources/Icon-Small-40@3x.png | Bin 0 -> 12610 bytes .../Resources/Icon-Small.png | Bin 0 -> 1144 bytes .../Resources/Icon-Small@2x.png | Bin 0 -> 955 bytes .../Resources/Icon-Small@3x.png | Bin 0 -> 7309 bytes .../Resources/LaunchScreen.storyboard | 39 + .../SubtitlesParserXamarinTest.iOS.csproj | 144 + .../iTunesArtwork | Bin 0 -> 16867 bytes .../iTunesArtwork@2x | Bin 0 -> 20666 bytes .../packages.config | 4 + .../SubtitlesParserXamarinTest/App.xaml | 10 + .../SubtitlesParserXamarinTest/App.xaml.cs | 34 + .../SubtitlesParserXamarinTest/MainPage.xaml | 7 + .../MainPage.xaml.cs | 17 + .../Properties/AssemblyInfo.cs | 30 + .../SubtitlesParserXamarinTest.csproj | 78 + .../packages.config | 4 + Test/App.config | 6 +- Test/Test.csproj | 5 +- 199 files changed, 55332 insertions(+), 739 deletions(-) delete mode 100644 SubtitlesParser/Classes/Parsers/YtXmlFormatParser.cs delete mode 100644 SubtitlesParser/SubtitlesParser.csproj delete mode 100644 SubtitlesParser/SubtitlesParser.nuspec rename {SubtitlesParser => SubtitlesParserNew}/Classes/Parsers/ISubtitlesParser.cs (93%) rename {SubtitlesParser => SubtitlesParserNew}/Classes/Parsers/MicroDvdParser.cs (96%) rename {SubtitlesParser => SubtitlesParserNew}/Classes/Parsers/SrtParser.cs (96%) rename {SubtitlesParser => SubtitlesParserNew}/Classes/Parsers/SsaParser.cs (99%) rename {SubtitlesParser => SubtitlesParserNew}/Classes/Parsers/SubParser.cs (98%) rename {SubtitlesParser => SubtitlesParserNew}/Classes/Parsers/SubViewerParser.cs (99%) rename {SubtitlesParser => SubtitlesParserNew}/Classes/Parsers/TtmlParser.cs (97%) rename {SubtitlesParser => SubtitlesParserNew}/Classes/Parsers/VttParser.cs (96%) mode change 100755 => 100644 rename {SubtitlesParser => SubtitlesParserNew}/Classes/StreamHelpers.cs (95%) rename {SubtitlesParser => SubtitlesParserNew}/Classes/SubtitleItem.cs (96%) rename {SubtitlesParser => SubtitlesParserNew}/Classes/SubtitlesFormat.cs (94%) create mode 100644 SubtitlesParserNew/SubtitlesParserNew.csproj create mode 100644 SubtitlesParserTest.Portable/App.xaml create mode 100644 SubtitlesParserTest.Portable/App.xaml.cs create mode 100644 SubtitlesParserTest.Portable/MainPage.xaml create mode 100644 SubtitlesParserTest.Portable/MainPage.xaml.cs create mode 100644 SubtitlesParserTest.Portable/SubtitlesParserTest.Portable.csproj create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/Assets/AboutAssets.txt create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/MainActivity.cs create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/Properties/AndroidManifest.xml create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/Properties/AssemblyInfo.cs create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/Resources/AboutResources.txt create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/Resources/Resource.Designer.cs create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/Resources/drawable-hdpi/icon.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/Resources/drawable-xhdpi/icon.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/Resources/drawable-xxhdpi/icon.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/Resources/drawable/icon.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/Resources/layout/Tabbar.axml create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/Resources/layout/Toolbar.axml create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/Resources/values/styles.xml create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/SubtitlesParserTest.Android.csproj create mode 100644 SubtitlesParserTest/SubtitlesParserTest.Android/packages.config create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/App.xaml create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/App.xaml.cs create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/LockScreenLogo.scale-100.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/LockScreenLogo.scale-125.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/LockScreenLogo.scale-150.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/LockScreenLogo.scale-200.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/LockScreenLogo.scale-400.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/SplashScreen.scale-100.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/SplashScreen.scale-125.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/SplashScreen.scale-150.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/SplashScreen.scale-200.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/SplashScreen.scale-400.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square150x150Logo.scale-100.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square150x150Logo.scale-125.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square150x150Logo.scale-150.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square150x150Logo.scale-200.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square150x150Logo.scale-400.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square44x44Logo.scale-100.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square44x44Logo.scale-125.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square44x44Logo.scale-150.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square44x44Logo.scale-200.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square44x44Logo.scale-400.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square44x44Logo.targetsize-16_altform-unplated.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square44x44Logo.targetsize-256_altform-unplated.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square44x44Logo.targetsize-32_altform-unplated.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Square44x44Logo.targetsize-48_altform-unplated.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/StoreLogo.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Wide310x150Logo.scale-100.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Wide310x150Logo.scale-125.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Wide310x150Logo.scale-150.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Wide310x150Logo.scale-200.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Assets/Wide310x150Logo.scale-400.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/MainPage.xaml create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/MainPage.xaml.cs create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Package.appxmanifest create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Properties/AssemblyInfo.cs create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/Properties/Default.rd.xml create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/SubtitlesParserTest.UWP.csproj create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/SubtitlesParserTest.UWP.nuget.props create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/SubtitlesParserTest.UWP.nuget.targets create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/SubtitlesParserTest.UWP_TemporaryKey.pfx create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/project.json create mode 100644 SubtitlesParserTest/SubtitlesParserTest.UWP/project.lock.json create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/AppDelegate.cs create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Entitlements.plist create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Info.plist create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Main.cs rename {SubtitlesParser => SubtitlesParserTest/SubtitlesParserTest.iOS}/Properties/AssemblyInfo.cs (83%) create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Default-568h@2x.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Default-Portrait.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Default-Portrait@2x.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Default.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Default@2x.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Icon-60@2x.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Icon-60@3x.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Icon-76.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Icon-76@2x.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Icon-Small-40.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Icon-Small-40@2x.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Icon-Small-40@3x.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Icon-Small.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Icon-Small@2x.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/Icon-Small@3x.png create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/Resources/LaunchScreen.storyboard create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/SubtitlesParserTest.iOS.csproj create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/iTunesArtwork create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/iTunesArtwork@2x create mode 100644 SubtitlesParserTest/SubtitlesParserTest.iOS/packages.config create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/Assets/AboutAssets.txt create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/MainActivity.cs create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/Properties/AndroidManifest.xml create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/Properties/AssemblyInfo.cs create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/Resources/AboutResources.txt create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/Resources/Resource.Designer.cs create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/Resources/drawable-hdpi/icon.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/Resources/drawable-xhdpi/icon.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/Resources/drawable-xxhdpi/icon.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/Resources/drawable/icon.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/Resources/layout/Tabbar.axml create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/Resources/layout/Toolbar.axml create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/Resources/values/styles.xml create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/SubtitlesParserXamarinTest.Android.csproj create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.Android/packages.config create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/2518_aud_SpReco.ttml create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/2518_aud_SpReco.vtt create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/App.xaml create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/App.xaml.cs create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/LockScreenLogo.scale-100.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/LockScreenLogo.scale-125.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/LockScreenLogo.scale-150.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/LockScreenLogo.scale-200.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/LockScreenLogo.scale-400.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/SplashScreen.scale-100.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/SplashScreen.scale-125.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/SplashScreen.scale-150.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/SplashScreen.scale-200.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/SplashScreen.scale-400.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square150x150Logo.scale-100.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square150x150Logo.scale-125.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square150x150Logo.scale-150.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square150x150Logo.scale-200.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square150x150Logo.scale-400.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square44x44Logo.scale-100.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square44x44Logo.scale-125.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square44x44Logo.scale-150.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square44x44Logo.scale-200.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square44x44Logo.scale-400.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square44x44Logo.targetsize-16_altform-unplated.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square44x44Logo.targetsize-256_altform-unplated.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square44x44Logo.targetsize-32_altform-unplated.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Square44x44Logo.targetsize-48_altform-unplated.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/StoreLogo.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Wide310x150Logo.scale-100.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Wide310x150Logo.scale-125.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Wide310x150Logo.scale-150.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Wide310x150Logo.scale-200.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Assets/Wide310x150Logo.scale-400.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/MainPage.xaml create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/MainPage.xaml.cs create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Package.appxmanifest create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Properties/AssemblyInfo.cs create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/Properties/Default.rd.xml create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/SubtitlesParserXamarinTest.UWP.csproj create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/SubtitlesParserXamarinTest.UWP.nuget.targets create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/SubtitlesParserXamarinTest.UWP_TemporaryKey.pfx create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/project.json create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.UWP/project.lock.json create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/AppDelegate.cs create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Entitlements.plist create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Info.plist create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Main.cs create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Properties/AssemblyInfo.cs create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Default-568h@2x.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Default-Portrait.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Default-Portrait@2x.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Default.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Default@2x.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Icon-60@2x.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Icon-60@3x.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Icon-76.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Icon-76@2x.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Icon-Small-40.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Icon-Small-40@2x.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Icon-Small-40@3x.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Icon-Small.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Icon-Small@2x.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/Icon-Small@3x.png create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/Resources/LaunchScreen.storyboard create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/SubtitlesParserXamarinTest.iOS.csproj create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/iTunesArtwork create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/iTunesArtwork@2x create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.iOS/packages.config create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest/App.xaml create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest/App.xaml.cs create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest/MainPage.xaml create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest/MainPage.xaml.cs create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest/Properties/AssemblyInfo.cs create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest/SubtitlesParserXamarinTest.csproj create mode 100644 SubtitlesParserXamarinTest/SubtitlesParserXamarinTest/packages.config diff --git a/SubtitlesParser.sln b/SubtitlesParser.sln index fa716c4..1b035f7 100644 --- a/SubtitlesParser.sln +++ b/SubtitlesParser.sln @@ -1,44 +1,235 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubtitlesParser", "SubtitlesParser\SubtitlesParser.csproj", "{6F33AA98-2275-4241-BBED-B3D02BDE5EBB}" +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubtitlesParserNew", "SubtitlesParserNew\SubtitlesParserNew.csproj", "{19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{3617CC79-3E2F-4BD6-B2CF-CA1F42176C18}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubtitlesParserTest.UWP", "SubtitlesParserTest\SubtitlesParserTest.UWP\SubtitlesParserTest.UWP.csproj", "{896FF977-5896-4CE1-B914-F1E635F63E6B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubtitlesParserTest.Portable", "SubtitlesParserTest.Portable\SubtitlesParserTest.Portable.csproj", "{4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Ad-Hoc|Any CPU = Ad-Hoc|Any CPU + Ad-Hoc|ARM = Ad-Hoc|ARM + Ad-Hoc|iPhone = Ad-Hoc|iPhone + Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator + Ad-Hoc|Mixed Platforms = Ad-Hoc|Mixed Platforms + Ad-Hoc|x64 = Ad-Hoc|x64 + Ad-Hoc|x86 = Ad-Hoc|x86 + AppStore|Any CPU = AppStore|Any CPU + AppStore|ARM = AppStore|ARM + AppStore|iPhone = AppStore|iPhone + AppStore|iPhoneSimulator = AppStore|iPhoneSimulator + AppStore|Mixed Platforms = AppStore|Mixed Platforms + AppStore|x64 = AppStore|x64 + AppStore|x86 = AppStore|x86 Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|iPhone = Debug|iPhone + Debug|iPhoneSimulator = Debug|iPhoneSimulator Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|iPhone = Release|iPhone + Release|iPhoneSimulator = Release|iPhoneSimulator Release|Mixed Platforms = Release|Mixed Platforms + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6F33AA98-2275-4241-BBED-B3D02BDE5EBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6F33AA98-2275-4241-BBED-B3D02BDE5EBB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6F33AA98-2275-4241-BBED-B3D02BDE5EBB}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {6F33AA98-2275-4241-BBED-B3D02BDE5EBB}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {6F33AA98-2275-4241-BBED-B3D02BDE5EBB}.Debug|x86.ActiveCfg = Debug|Any CPU - {6F33AA98-2275-4241-BBED-B3D02BDE5EBB}.Debug|x86.Build.0 = Debug|Any CPU - {6F33AA98-2275-4241-BBED-B3D02BDE5EBB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6F33AA98-2275-4241-BBED-B3D02BDE5EBB}.Release|Any CPU.Build.0 = Release|Any CPU - {6F33AA98-2275-4241-BBED-B3D02BDE5EBB}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {6F33AA98-2275-4241-BBED-B3D02BDE5EBB}.Release|Mixed Platforms.Build.0 = Release|x86 - {6F33AA98-2275-4241-BBED-B3D02BDE5EBB}.Release|x86.ActiveCfg = Release|Any CPU - {6F33AA98-2275-4241-BBED-B3D02BDE5EBB}.Release|x86.Build.0 = Release|Any CPU - {3617CC79-3E2F-4BD6-B2CF-CA1F42176C18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3617CC79-3E2F-4BD6-B2CF-CA1F42176C18}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3617CC79-3E2F-4BD6-B2CF-CA1F42176C18}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3617CC79-3E2F-4BD6-B2CF-CA1F42176C18}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3617CC79-3E2F-4BD6-B2CF-CA1F42176C18}.Debug|x86.ActiveCfg = Debug|Any CPU - {3617CC79-3E2F-4BD6-B2CF-CA1F42176C18}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3617CC79-3E2F-4BD6-B2CF-CA1F42176C18}.Release|Any CPU.Build.0 = Release|Any CPU - {3617CC79-3E2F-4BD6-B2CF-CA1F42176C18}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3617CC79-3E2F-4BD6-B2CF-CA1F42176C18}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3617CC79-3E2F-4BD6-B2CF-CA1F42176C18}.Release|x86.ActiveCfg = Release|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Ad-Hoc|Mixed Platforms.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Ad-Hoc|Mixed Platforms.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.AppStore|ARM.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.AppStore|iPhone.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.AppStore|Mixed Platforms.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.AppStore|Mixed Platforms.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.AppStore|x64.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.AppStore|x64.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.AppStore|x86.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.AppStore|x86.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Debug|ARM.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Debug|ARM.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Debug|iPhone.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Debug|x64.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Debug|x64.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Debug|x86.ActiveCfg = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Debug|x86.Build.0 = Debug|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Release|Any CPU.Build.0 = Release|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Release|ARM.ActiveCfg = Release|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Release|ARM.Build.0 = Release|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Release|iPhone.ActiveCfg = Release|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Release|iPhone.Build.0 = Release|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Release|x64.ActiveCfg = Release|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Release|x64.Build.0 = Release|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Release|x86.ActiveCfg = Release|Any CPU + {19FEE46D-0FD5-47A8-BA7A-07A142AD4FF8}.Release|x86.Build.0 = Release|Any CPU + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|Any CPU.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|Any CPU.Build.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|Any CPU.Deploy.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|ARM.ActiveCfg = Release|ARM + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|ARM.Build.0 = Release|ARM + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|ARM.Deploy.0 = Release|ARM + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|iPhone.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|iPhone.Build.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|iPhone.Deploy.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|Mixed Platforms.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|Mixed Platforms.Build.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|Mixed Platforms.Deploy.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|x64.ActiveCfg = Release|x64 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|x64.Build.0 = Release|x64 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|x64.Deploy.0 = Release|x64 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|x86.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|x86.Build.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Ad-Hoc|x86.Deploy.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|Any CPU.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|Any CPU.Build.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|Any CPU.Deploy.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|ARM.ActiveCfg = Release|ARM + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|ARM.Build.0 = Release|ARM + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|ARM.Deploy.0 = Release|ARM + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|iPhone.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|iPhone.Build.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|iPhone.Deploy.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|iPhoneSimulator.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|iPhoneSimulator.Build.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|iPhoneSimulator.Deploy.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|Mixed Platforms.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|Mixed Platforms.Build.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|Mixed Platforms.Deploy.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|x64.ActiveCfg = Release|x64 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|x64.Build.0 = Release|x64 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|x64.Deploy.0 = Release|x64 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|x86.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|x86.Build.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.AppStore|x86.Deploy.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|Any CPU.ActiveCfg = Debug|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|ARM.ActiveCfg = Debug|ARM + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|ARM.Build.0 = Debug|ARM + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|ARM.Deploy.0 = Debug|ARM + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|iPhone.ActiveCfg = Debug|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|iPhoneSimulator.ActiveCfg = Debug|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|Mixed Platforms.Deploy.0 = Debug|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|x64.ActiveCfg = Debug|x64 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|x64.Build.0 = Debug|x64 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|x64.Deploy.0 = Debug|x64 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|x86.ActiveCfg = Debug|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|x86.Build.0 = Debug|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Debug|x86.Deploy.0 = Debug|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|Any CPU.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|ARM.ActiveCfg = Release|ARM + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|ARM.Build.0 = Release|ARM + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|ARM.Deploy.0 = Release|ARM + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|iPhone.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|iPhoneSimulator.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|Mixed Platforms.Build.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|Mixed Platforms.Deploy.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|x64.ActiveCfg = Release|x64 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|x64.Build.0 = Release|x64 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|x64.Deploy.0 = Release|x64 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|x86.ActiveCfg = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|x86.Build.0 = Release|x86 + {896FF977-5896-4CE1-B914-F1E635F63E6B}.Release|x86.Deploy.0 = Release|x86 + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Ad-Hoc|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Ad-Hoc|Mixed Platforms.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.AppStore|ARM.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.AppStore|iPhone.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.AppStore|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.AppStore|Mixed Platforms.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.AppStore|x64.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.AppStore|x64.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.AppStore|x86.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.AppStore|x86.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Debug|ARM.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Debug|ARM.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Debug|iPhone.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Debug|x64.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Debug|x64.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Debug|x86.ActiveCfg = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Debug|x86.Build.0 = Debug|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Release|Any CPU.Build.0 = Release|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Release|ARM.ActiveCfg = Release|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Release|ARM.Build.0 = Release|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Release|iPhone.ActiveCfg = Release|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Release|iPhone.Build.0 = Release|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Release|x64.ActiveCfg = Release|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Release|x64.Build.0 = Release|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Release|x86.ActiveCfg = Release|Any CPU + {4D2BBD77-5FB5-46ED-B7D5-924A03790DBA}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A9C01F37-CEE8-4E23-82E9-9D098E0D8FB0} + EndGlobalSection EndGlobal diff --git a/SubtitlesParser/Classes/Parsers/YtXmlFormatParser.cs b/SubtitlesParser/Classes/Parsers/YtXmlFormatParser.cs deleted file mode 100644 index 98d885b..0000000 --- a/SubtitlesParser/Classes/Parsers/YtXmlFormatParser.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Text; -using System.Xml; - -namespace SubtitlesParser.Classes.Parsers -{ - public class YtXmlFormatParser : ISubtitlesParser - { - public List ParseStream(Stream xmlStream, Encoding encoding) - { - // rewind the stream - xmlStream.Position = 0; - var items = new List(); - - // parse xml stream - var xmlDoc = new XmlDocument(); - xmlDoc.Load(xmlStream); - - if (xmlDoc.DocumentElement != null) - { - var nodeList = xmlDoc.DocumentElement.SelectNodes("//text"); - - if (nodeList != null) - { - for (var i = 0; i < nodeList.Count; i++) - { - var node = nodeList[i]; - try - { - var startString = node.Attributes["start"].Value; - float start = float.Parse(startString, CultureInfo.InvariantCulture); - var durString = node.Attributes["dur"].Value; - float duration = float.Parse(durString, CultureInfo.InvariantCulture); - var text = node.InnerText; - - items.Add(new SubtitleItem() - { - StartTime = (int)(start * 1000), - EndTime = (int)((start + duration) * 1000), - Lines = new List() { text } - }); - } - catch (Exception ex) - { - Console.WriteLine("Exception raised when parsing xml node {0}: {1}", node, ex); - } - } - } - } - - if (items.Any()) - { - return items; - } - else - { - throw new ArgumentException("Stream is not in a valid Youtube XML format"); - } - } - } -} diff --git a/SubtitlesParser/SubtitlesParser.csproj b/SubtitlesParser/SubtitlesParser.csproj deleted file mode 100644 index 2da3554..0000000 --- a/SubtitlesParser/SubtitlesParser.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {6F33AA98-2275-4241-BBED-B3D02BDE5EBB} - Library - Properties - SubtitlesParser - SubtitlesParser - v4.0 - Client - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - true - bin\Debug\ - DEBUG;TRACE - full - AnyCPU - bin\Debug\SubtitlesParser.dll.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - MinimumRecommendedRules.ruleset - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - true - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - true - - - bin\Release\ - TRACE - true - pdbonly - AnyCPU - bin\Release\SubtitlesParser.dll.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - MinimumRecommendedRules.ruleset - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(SolutionDir)nuget\NuGet.exe pack $(SolutionDir)\SubtitlesParser\SubtitlesParser.csproj -Prop Configuration=$(ConfigurationName) - - - \ No newline at end of file diff --git a/SubtitlesParser/SubtitlesParser.nuspec b/SubtitlesParser/SubtitlesParser.nuspec deleted file mode 100644 index 11c3bda..0000000 --- a/SubtitlesParser/SubtitlesParser.nuspec +++ /dev/null @@ -1,16 +0,0 @@ - - - - SubtitlesParser - 1.4.7 - Subtitles parser - AlexPoint - AlexPoint - https://github.com/AlexPoint/SubtitlesParser - false - Universal subtitles parser - Made Ttml and Srt parsers more robust - Copyright 2016 - subtitles parser - - \ No newline at end of file diff --git a/SubtitlesParser/Classes/Parsers/ISubtitlesParser.cs b/SubtitlesParserNew/Classes/Parsers/ISubtitlesParser.cs similarity index 93% rename from SubtitlesParser/Classes/Parsers/ISubtitlesParser.cs rename to SubtitlesParserNew/Classes/Parsers/ISubtitlesParser.cs index dd1b908..56d3d1c 100644 --- a/SubtitlesParser/Classes/Parsers/ISubtitlesParser.cs +++ b/SubtitlesParserNew/Classes/Parsers/ISubtitlesParser.cs @@ -2,7 +2,7 @@ using System.IO; using System.Text; -namespace SubtitlesParser.Classes.Parsers +namespace SubtitlesParserNew.Classes.Parsers { /// /// Interface specifying the required method for a SubParser. diff --git a/SubtitlesParser/Classes/Parsers/MicroDvdParser.cs b/SubtitlesParserNew/Classes/Parsers/MicroDvdParser.cs similarity index 96% rename from SubtitlesParser/Classes/Parsers/MicroDvdParser.cs rename to SubtitlesParserNew/Classes/Parsers/MicroDvdParser.cs index 4f1ccf8..0a736d7 100644 --- a/SubtitlesParser/Classes/Parsers/MicroDvdParser.cs +++ b/SubtitlesParserNew/Classes/Parsers/MicroDvdParser.cs @@ -6,7 +6,7 @@ using System.Text; using System.Text.RegularExpressions; -namespace SubtitlesParser.Classes.Parsers +namespace SubtitlesParserNew.Classes.Parsers { /// /// Parser for MicroDVD .sub subtitles files @@ -74,8 +74,6 @@ public List ParseStream(Stream subStream, Encoding encoding) var success = TryExtractFrameRate(firstItem.Lines[0], out frameRate); if (!success) { - Console.WriteLine("Couldn't extract frame rate of sub file with first line {0}. " + - "We use the default frame rate: {1}", line, defaultFrameRate); frameRate = defaultFrameRate; // treat it as a regular line diff --git a/SubtitlesParser/Classes/Parsers/SrtParser.cs b/SubtitlesParserNew/Classes/Parsers/SrtParser.cs similarity index 96% rename from SubtitlesParser/Classes/Parsers/SrtParser.cs rename to SubtitlesParserNew/Classes/Parsers/SrtParser.cs index 30024db..04662f3 100644 --- a/SubtitlesParser/Classes/Parsers/SrtParser.cs +++ b/SubtitlesParserNew/Classes/Parsers/SrtParser.cs @@ -1,190 +1,190 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; - -namespace SubtitlesParser.Classes.Parsers -{ - /// - /// Parser for the .srt subtitles files - /// - /// A .srt file looks like: - /// 1 - /// 00:00:10,500 --> 00:00:13,000 - /// Elephant's Dream - /// - /// 2 - /// 00:00:15,000 --> 00:00:18,000 - /// At the left we can see...[12] - /// - public class SrtParser: ISubtitlesParser - { - - // Properties ----------------------------------------------------------------------- - - private readonly string[] _delimiters = { "-->" , "- >", "->" }; - - - // Constructors -------------------------------------------------------------------- - - public SrtParser(){} - - - // Methods ------------------------------------------------------------------------- - - public List ParseStream(Stream srtStream, Encoding encoding) - { - // test if stream if readable and seekable (just a check, should be good) - if (!srtStream.CanRead || !srtStream.CanSeek) - { - var message = string.Format("Stream must be seekable and readable in a subtitles parser. " + - "Operation interrupted; isSeekable: {0} - isReadable: {1}", - srtStream.CanSeek, srtStream.CanSeek); - throw new ArgumentException(message); - } - - // seek the beginning of the stream - srtStream.Position = 0; - - var reader = new StreamReader(srtStream, encoding, true); - - var items = new List(); - var srtSubParts = GetSrtSubTitleParts(reader).ToList(); - if (srtSubParts.Any()) - { - foreach (var srtSubPart in srtSubParts) - { - var lines = - srtSubPart.Split(new string[] {Environment.NewLine}, StringSplitOptions.None) - .Select(s => s.Trim()) - .Where(l => !string.IsNullOrEmpty(l)) - .ToList(); - - var item = new SubtitleItem(); - foreach (var line in lines) - { - if (item.StartTime == 0 && item.EndTime == 0) - { - // we look for the timecodes first - int startTc; - int endTc; - var success = TryParseTimecodeLine(line, out startTc, out endTc); - if (success) - { - item.StartTime = startTc; - item.EndTime = endTc; - } - } - else - { - // we found the timecode, now we get the text - item.Lines.Add(line); - } - } - - if ((item.StartTime != 0 || item.EndTime != 0) && item.Lines.Any()) - { - // parsing succeeded - items.Add(item); - } - } - - if (items.Any()) - { - return items; - } - else - { - throw new ArgumentException("Stream is not in a valid Srt format"); - } - } - else - { - throw new FormatException("Parsing as srt returned no srt part."); - } - } - - /// - /// Enumerates the subtitle parts in a srt file based on the standard line break observed between them. - /// A srt subtitle part is in the form: - /// - /// 1 - /// 00:00:20,000 --> 00:00:24,400 - /// Altocumulus clouds occur between six thousand - /// - /// - /// The textreader associated with the srt file - /// An IEnumerable(string) object containing all the subtitle parts - private IEnumerable GetSrtSubTitleParts(TextReader reader) - { - string line; - var sb = new StringBuilder(); - - while ((line = reader.ReadLine()) != null) - { - if (string.IsNullOrEmpty(line.Trim())) - { - // return only if not empty - var res = sb.ToString().TrimEnd(); - if (!string.IsNullOrEmpty(res)) - { - yield return res; - } - sb = new StringBuilder(); - } - else - { - sb.AppendLine(line); - } - } - - if (sb.Length > 0) - { - yield return sb.ToString(); - } - } - - private bool TryParseTimecodeLine(string line, out int startTc, out int endTc) - { - var parts = line.Split(_delimiters, StringSplitOptions.None); - if (parts.Length != 2) - { - // this is not a timecode line - startTc = -1; - endTc = -1; - return false; - } - else - { - startTc = ParseSrtTimecode(parts[0]); - endTc = ParseSrtTimecode(parts[1]); - return true; - } - } - - /// - /// Takes an SRT timecode as a string and parses it into a double (in seconds). A SRT timecode reads as follows: - /// 00:00:20,000 - /// - /// The timecode to parse - /// The parsed timecode as a TimeSpan instance. If the parsing was unsuccessful, -1 is returned (subtitles should never show) - private static int ParseSrtTimecode(string s) - { - var match = Regex.Match(s, "[0-9]+:[0-9]+:[0-9]+([,\\.][0-9]+)?"); - if (match.Success) - { - s = match.Value; - TimeSpan result; - if (TimeSpan.TryParse(s.Replace(',', '.'), out result)) - { - var nbOfMs = (int)result.TotalMilliseconds; - return nbOfMs; - } - } - return -1; - } - - } +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; + +namespace SubtitlesParserNew.Classes.Parsers +{ + /// + /// Parser for the .srt subtitles files + /// + /// A .srt file looks like: + /// 1 + /// 00:00:10,500 --> 00:00:13,000 + /// Elephant's Dream + /// + /// 2 + /// 00:00:15,000 --> 00:00:18,000 + /// At the left we can see...[12] + /// + public class SrtParser: ISubtitlesParser + { + + // Properties ----------------------------------------------------------------------- + + private readonly string[] _delimiters = { "-->" , "- >", "->" }; + + + // Constructors -------------------------------------------------------------------- + + public SrtParser(){} + + + // Methods ------------------------------------------------------------------------- + + public List ParseStream(Stream srtStream, Encoding encoding) + { + // test if stream if readable and seekable (just a check, should be good) + if (!srtStream.CanRead || !srtStream.CanSeek) + { + var message = string.Format("Stream must be seekable and readable in a subtitles parser. " + + "Operation interrupted; isSeekable: {0} - isReadable: {1}", + srtStream.CanSeek, srtStream.CanSeek); + throw new ArgumentException(message); + } + + // seek the beginning of the stream + srtStream.Position = 0; + + var reader = new StreamReader(srtStream, encoding, true); + + var items = new List(); + var srtSubParts = GetSrtSubTitleParts(reader).ToList(); + if (srtSubParts.Any()) + { + foreach (var srtSubPart in srtSubParts) + { + var lines = + srtSubPart.Split(new string[] {Environment.NewLine}, StringSplitOptions.None) + .Select(s => s.Trim()) + .Where(l => !string.IsNullOrEmpty(l)) + .ToList(); + + var item = new SubtitleItem(); + foreach (var line in lines) + { + if (item.StartTime == 0 && item.EndTime == 0) + { + // we look for the timecodes first + int startTc; + int endTc; + var success = TryParseTimecodeLine(line, out startTc, out endTc); + if (success) + { + item.StartTime = startTc; + item.EndTime = endTc; + } + } + else + { + // we found the timecode, now we get the text + item.Lines.Add(line); + } + } + + if ((item.StartTime != 0 || item.EndTime != 0) && item.Lines.Any()) + { + // parsing succeeded + items.Add(item); + } + } + + if (items.Any()) + { + return items; + } + else + { + throw new ArgumentException("Stream is not in a valid Srt format"); + } + } + else + { + throw new FormatException("Parsing as srt returned no srt part."); + } + } + + /// + /// Enumerates the subtitle parts in a srt file based on the standard line break observed between them. + /// A srt subtitle part is in the form: + /// + /// 1 + /// 00:00:20,000 --> 00:00:24,400 + /// Altocumulus clouds occur between six thousand + /// + /// + /// The textreader associated with the srt file + /// An IEnumerable(string) object containing all the subtitle parts + private IEnumerable GetSrtSubTitleParts(TextReader reader) + { + string line; + var sb = new StringBuilder(); + + while ((line = reader.ReadLine()) != null) + { + if (string.IsNullOrEmpty(line.Trim())) + { + // return only if not empty + var res = sb.ToString().TrimEnd(); + if (!string.IsNullOrEmpty(res)) + { + yield return res; + } + sb = new StringBuilder(); + } + else + { + sb.AppendLine(line); + } + } + + if (sb.Length > 0) + { + yield return sb.ToString(); + } + } + + private bool TryParseTimecodeLine(string line, out int startTc, out int endTc) + { + var parts = line.Split(_delimiters, StringSplitOptions.None); + if (parts.Length != 2) + { + // this is not a timecode line + startTc = -1; + endTc = -1; + return false; + } + else + { + startTc = ParseSrtTimecode(parts[0]); + endTc = ParseSrtTimecode(parts[1]); + return true; + } + } + + /// + /// Takes an SRT timecode as a string and parses it into a double (in seconds). A SRT timecode reads as follows: + /// 00:00:20,000 + /// + /// The timecode to parse + /// The parsed timecode as a TimeSpan instance. If the parsing was unsuccessful, -1 is returned (subtitles should never show) + private static int ParseSrtTimecode(string s) + { + var match = Regex.Match(s, "[0-9]+:[0-9]+:[0-9]+([,\\.][0-9]+)?"); + if (match.Success) + { + s = match.Value; + TimeSpan result; + if (TimeSpan.TryParse(s.Replace(',', '.'), out result)) + { + var nbOfMs = (int)result.TotalMilliseconds; + return nbOfMs; + } + } + return -1; + } + + } } \ No newline at end of file diff --git a/SubtitlesParser/Classes/Parsers/SsaParser.cs b/SubtitlesParserNew/Classes/Parsers/SsaParser.cs similarity index 99% rename from SubtitlesParser/Classes/Parsers/SsaParser.cs rename to SubtitlesParserNew/Classes/Parsers/SsaParser.cs index 82535a4..0832979 100644 --- a/SubtitlesParser/Classes/Parsers/SsaParser.cs +++ b/SubtitlesParserNew/Classes/Parsers/SsaParser.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; -namespace SubtitlesParser.Classes.Parsers +namespace SubtitlesParserNew.Classes.Parsers { /// /// A parser for the SubStation Alpha subtitles format. diff --git a/SubtitlesParser/Classes/Parsers/SubParser.cs b/SubtitlesParserNew/Classes/Parsers/SubParser.cs similarity index 98% rename from SubtitlesParser/Classes/Parsers/SubParser.cs rename to SubtitlesParserNew/Classes/Parsers/SubParser.cs index f36159a..6bac0e9 100644 --- a/SubtitlesParser/Classes/Parsers/SubParser.cs +++ b/SubtitlesParserNew/Classes/Parsers/SubParser.cs @@ -5,7 +5,7 @@ using System.Text; using System.Text.RegularExpressions; -namespace SubtitlesParser.Classes.Parsers +namespace SubtitlesParserNew.Classes.Parsers { public class SubParser { @@ -19,7 +19,6 @@ public class SubParser {SubtitlesFormat.SubStationAlphaFormat, new SsaParser()}, {SubtitlesFormat.TtmlFormat, new TtmlParser()}, {SubtitlesFormat.WebVttFormat, new VttParser()}, - {SubtitlesFormat.YoutubeXmlFormat, new YtXmlFormatParser()} }; diff --git a/SubtitlesParser/Classes/Parsers/SubViewerParser.cs b/SubtitlesParserNew/Classes/Parsers/SubViewerParser.cs similarity index 99% rename from SubtitlesParser/Classes/Parsers/SubViewerParser.cs rename to SubtitlesParserNew/Classes/Parsers/SubViewerParser.cs index c594d3a..4e354c4 100644 --- a/SubtitlesParser/Classes/Parsers/SubViewerParser.cs +++ b/SubtitlesParserNew/Classes/Parsers/SubViewerParser.cs @@ -5,7 +5,7 @@ using System.Text; using System.Text.RegularExpressions; -namespace SubtitlesParser.Classes.Parsers +namespace SubtitlesParserNew.Classes.Parsers { /// /// Parser for SubViewer .sub subtitles files diff --git a/SubtitlesParser/Classes/Parsers/TtmlParser.cs b/SubtitlesParserNew/Classes/Parsers/TtmlParser.cs similarity index 97% rename from SubtitlesParser/Classes/Parsers/TtmlParser.cs rename to SubtitlesParserNew/Classes/Parsers/TtmlParser.cs index 3800416..09ae04c 100644 --- a/SubtitlesParser/Classes/Parsers/TtmlParser.cs +++ b/SubtitlesParserNew/Classes/Parsers/TtmlParser.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Linq; using System.Text; -using System.Xml; using System.Xml.Linq; -namespace SubtitlesParser.Classes.Parsers +namespace SubtitlesParserNew.Classes.Parsers { public class TtmlParser : ISubtitlesParser { diff --git a/SubtitlesParser/Classes/Parsers/VttParser.cs b/SubtitlesParserNew/Classes/Parsers/VttParser.cs old mode 100755 new mode 100644 similarity index 96% rename from SubtitlesParser/Classes/Parsers/VttParser.cs rename to SubtitlesParserNew/Classes/Parsers/VttParser.cs index bcc0127..9335db1 --- a/SubtitlesParser/Classes/Parsers/VttParser.cs +++ b/SubtitlesParserNew/Classes/Parsers/VttParser.cs @@ -1,209 +1,209 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; - -namespace SubtitlesParser.Classes.Parsers -{ - /// - /// Parser for the .vtt subtitles files. Does not handle formatting tags within the text; that has to be parsed separately. - /// - /// A .vtt file looks like: - /// WEBVTT - /// - /// CUE - 1 - /// 00:00:10.500 --> 00:00:13.000 - /// Elephant's Dream - /// - /// CUE - 2 - /// 00:00:15.000 --> 00:00:18.000 - /// At the left we can see... - /// - public class VttParser : ISubtitlesParser - { - - // Properties ----------------------------------------------------------------------- - - private readonly string[] _delimiters = new string[] { "-->", "- >", "->" }; - - - // Constructors -------------------------------------------------------------------- - - public VttParser() { } - - - // Methods ------------------------------------------------------------------------- - - public List ParseStream(Stream vttStream, Encoding encoding) - { - // test if stream if readable and seekable (just a check, should be good) - if (!vttStream.CanRead || !vttStream.CanSeek) - { - var message = string.Format("Stream must be seekable and readable in a subtitles parser. " + - "Operation interrupted; isSeekable: {0} - isReadable: {1}", - vttStream.CanSeek, vttStream.CanSeek); - throw new ArgumentException(message); - } - - // seek the beginning of the stream - vttStream.Position = 0; - - var reader = new StreamReader(vttStream, encoding, true); - - var items = new List(); - var vttSubParts = GetVttSubTitleParts(reader).ToList(); - if (vttSubParts.Any()) - { - foreach (var vttSubPart in vttSubParts) - { - var lines = - vttSubPart.Split(new string[] { Environment.NewLine }, StringSplitOptions.None) - .Select(s => s.Trim()) - .Where(l => !string.IsNullOrEmpty(l)) - .ToList(); - - var item = new SubtitleItem(); - foreach (var line in lines) - { - if (item.StartTime == 0 && item.EndTime == 0) - { - // we look for the timecodes first - int startTc; - int endTc; - var success = TryParseTimecodeLine(line, out startTc, out endTc); - if (success) - { - item.StartTime = startTc; - item.EndTime = endTc; - } - } - else - { - // we found the timecode, now we get the text - item.Lines.Add(line); - } - } - - if ((item.StartTime != 0 || item.EndTime != 0) && item.Lines.Any()) - { - // parsing succeeded - items.Add(item); - } - } - - if (items.Any()) - { - return items; - } - else - { - throw new ArgumentException("Stream is not in a valid VTT format"); - } - } - else - { - throw new FormatException("Parsing as VTT returned no VTT part."); - } - } - - /// - /// Enumerates the subtitle parts in a VTT file based on the standard line break observed between them. - /// A VTT subtitle part is in the form: - /// - /// CUE - 1 - /// 00:00:20.000 --> 00:00:24.400 - /// Altocumulus clouds occur between six thousand - /// - /// The first line is optional, as well as the hours in the time codes. - /// - /// The textreader associated with the vtt file - /// An IEnumerable(string) object containing all the subtitle parts - private IEnumerable GetVttSubTitleParts(TextReader reader) - { - string line; - var sb = new StringBuilder(); - - while ((line = reader.ReadLine()) != null) - { - if (string.IsNullOrEmpty(line.Trim())) - { - // return only if not empty - var res = sb.ToString().TrimEnd(); - if (!string.IsNullOrEmpty(res)) - { - yield return res; - } - sb = new StringBuilder(); - } - else - { - sb.AppendLine(line); - } - } - - if (sb.Length > 0) - { - yield return sb.ToString(); - } - } - - private bool TryParseTimecodeLine(string line, out int startTc, out int endTc) - { - var parts = line.Split(_delimiters, StringSplitOptions.None); - if (parts.Length != 2) - { - // this is not a timecode line - startTc = -1; - endTc = -1; - return false; - } - else - { - startTc = ParseVttTimecode(parts[0]); - endTc = ParseVttTimecode(parts[1]); - return true; - } - } - - /// - /// Takes an VTT timecode as a string and parses it into a double (in seconds). A VTT timecode reads as follows: - /// 00:00:20.000 - /// or - /// 00:20.000 - /// - /// The timecode to parse - /// The parsed timecode as a TimeSpan instance. If the parsing was unsuccessful, -1 is returned (subtitles should never show) - private int ParseVttTimecode(string s) - { - string timeString = string.Empty; - var match = Regex.Match(s, "[0-9]+:[0-9]+:[0-9]+[,\\.][0-9]+"); - if (match.Success) - { - timeString = match.Value; - } - else - { - match = Regex.Match(s, "[0-9]+:[0-9]+[,\\.][0-9]+"); - if (match.Success) - { - timeString = "00:" + match.Value; - } - } - - if (!string.IsNullOrEmpty(timeString)) - { - timeString = timeString.Replace(',', '.'); - TimeSpan result; - if (TimeSpan.TryParse(timeString, out result)) - { - var nbOfMs = (int)result.TotalMilliseconds; - return nbOfMs; - } - } - - return -1; - } - } +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; + +namespace SubtitlesParserNew.Classes.Parsers +{ + /// + /// Parser for the .vtt subtitles files. Does not handle formatting tags within the text; that has to be parsed separately. + /// + /// A .vtt file looks like: + /// WEBVTT + /// + /// CUE - 1 + /// 00:00:10.500 --> 00:00:13.000 + /// Elephant's Dream + /// + /// CUE - 2 + /// 00:00:15.000 --> 00:00:18.000 + /// At the left we can see... + /// + public class VttParser : ISubtitlesParser + { + + // Properties ----------------------------------------------------------------------- + + private readonly string[] _delimiters = new string[] { "-->", "- >", "->" }; + + + // Constructors -------------------------------------------------------------------- + + public VttParser() { } + + + // Methods ------------------------------------------------------------------------- + + public List ParseStream(Stream vttStream, Encoding encoding) + { + // test if stream if readable and seekable (just a check, should be good) + if (!vttStream.CanRead || !vttStream.CanSeek) + { + var message = string.Format("Stream must be seekable and readable in a subtitles parser. " + + "Operation interrupted; isSeekable: {0} - isReadable: {1}", + vttStream.CanSeek, vttStream.CanSeek); + throw new ArgumentException(message); + } + + // seek the beginning of the stream + vttStream.Position = 0; + + var reader = new StreamReader(vttStream, encoding, true); + + var items = new List(); + var vttSubParts = GetVttSubTitleParts(reader).ToList(); + if (vttSubParts.Any()) + { + foreach (var vttSubPart in vttSubParts) + { + var lines = + vttSubPart.Split(new string[] { Environment.NewLine }, StringSplitOptions.None) + .Select(s => s.Trim()) + .Where(l => !string.IsNullOrEmpty(l)) + .ToList(); + + var item = new SubtitleItem(); + foreach (var line in lines) + { + if (item.StartTime == 0 && item.EndTime == 0) + { + // we look for the timecodes first + int startTc; + int endTc; + var success = TryParseTimecodeLine(line, out startTc, out endTc); + if (success) + { + item.StartTime = startTc; + item.EndTime = endTc; + } + } + else + { + // we found the timecode, now we get the text + item.Lines.Add(line); + } + } + + if ((item.StartTime != 0 || item.EndTime != 0) && item.Lines.Any()) + { + // parsing succeeded + items.Add(item); + } + } + + if (items.Any()) + { + return items; + } + else + { + throw new ArgumentException("Stream is not in a valid VTT format"); + } + } + else + { + throw new FormatException("Parsing as VTT returned no VTT part."); + } + } + + /// + /// Enumerates the subtitle parts in a VTT file based on the standard line break observed between them. + /// A VTT subtitle part is in the form: + /// + /// CUE - 1 + /// 00:00:20.000 --> 00:00:24.400 + /// Altocumulus clouds occur between six thousand + /// + /// The first line is optional, as well as the hours in the time codes. + /// + /// The textreader associated with the vtt file + /// An IEnumerable(string) object containing all the subtitle parts + private IEnumerable GetVttSubTitleParts(TextReader reader) + { + string line; + var sb = new StringBuilder(); + + while ((line = reader.ReadLine()) != null) + { + if (string.IsNullOrEmpty(line.Trim())) + { + // return only if not empty + var res = sb.ToString().TrimEnd(); + if (!string.IsNullOrEmpty(res)) + { + yield return res; + } + sb = new StringBuilder(); + } + else + { + sb.AppendLine(line); + } + } + + if (sb.Length > 0) + { + yield return sb.ToString(); + } + } + + private bool TryParseTimecodeLine(string line, out int startTc, out int endTc) + { + var parts = line.Split(_delimiters, StringSplitOptions.None); + if (parts.Length != 2) + { + // this is not a timecode line + startTc = -1; + endTc = -1; + return false; + } + else + { + startTc = ParseVttTimecode(parts[0]); + endTc = ParseVttTimecode(parts[1]); + return true; + } + } + + /// + /// Takes an VTT timecode as a string and parses it into a double (in seconds). A VTT timecode reads as follows: + /// 00:00:20.000 + /// or + /// 00:20.000 + /// + /// The timecode to parse + /// The parsed timecode as a TimeSpan instance. If the parsing was unsuccessful, -1 is returned (subtitles should never show) + private int ParseVttTimecode(string s) + { + string timeString = string.Empty; + var match = Regex.Match(s, "[0-9]+:[0-9]+:[0-9]+[,\\.][0-9]+"); + if (match.Success) + { + timeString = match.Value; + } + else + { + match = Regex.Match(s, "[0-9]+:[0-9]+[,\\.][0-9]+"); + if (match.Success) + { + timeString = "00:" + match.Value; + } + } + + if (!string.IsNullOrEmpty(timeString)) + { + timeString = timeString.Replace(',', '.'); + TimeSpan result; + if (TimeSpan.TryParse(timeString, out result)) + { + var nbOfMs = (int)result.TotalMilliseconds; + return nbOfMs; + } + } + + return -1; + } + } } \ No newline at end of file diff --git a/SubtitlesParser/Classes/StreamHelpers.cs b/SubtitlesParserNew/Classes/StreamHelpers.cs similarity index 95% rename from SubtitlesParser/Classes/StreamHelpers.cs rename to SubtitlesParserNew/Classes/StreamHelpers.cs index 32e9d63..0104959 100644 --- a/SubtitlesParser/Classes/StreamHelpers.cs +++ b/SubtitlesParserNew/Classes/StreamHelpers.cs @@ -1,6 +1,6 @@ using System.IO; -namespace SubtitlesParser.Classes +namespace SubtitlesParserNew.Classes { static class StreamHelpers { diff --git a/SubtitlesParser/Classes/SubtitleItem.cs b/SubtitlesParserNew/Classes/SubtitleItem.cs similarity index 96% rename from SubtitlesParser/Classes/SubtitleItem.cs rename to SubtitlesParserNew/Classes/SubtitleItem.cs index 7ea3626..8566ba0 100644 --- a/SubtitlesParser/Classes/SubtitleItem.cs +++ b/SubtitlesParserNew/Classes/SubtitleItem.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace SubtitlesParser.Classes +namespace SubtitlesParserNew.Classes { public class SubtitleItem { diff --git a/SubtitlesParser/Classes/SubtitlesFormat.cs b/SubtitlesParserNew/Classes/SubtitlesFormat.cs similarity index 94% rename from SubtitlesParser/Classes/SubtitlesFormat.cs rename to SubtitlesParserNew/Classes/SubtitlesFormat.cs index a6f08aa..ebf2893 100644 --- a/SubtitlesParser/Classes/SubtitlesFormat.cs +++ b/SubtitlesParserNew/Classes/SubtitlesFormat.cs @@ -1,70 +1,70 @@ -using System.Collections.Generic; - -namespace SubtitlesParser.Classes -{ - public class SubtitlesFormat - { - // Properties ----------------------------------------- - - public string Name { get; set; } - public string Extension { get; set; } - - - // Private constructor to avoid duplicates ------------ - - private SubtitlesFormat(){} - - - // Predefined instances ------------------------------- - - public static SubtitlesFormat SubRipFormat = new SubtitlesFormat() - { - Name = "SubRip", - Extension = @"\.srt" - }; - public static SubtitlesFormat MicroDvdFormat = new SubtitlesFormat() - { - Name = "MicroDvd", - Extension = @"\.sub" - }; - public static SubtitlesFormat SubViewerFormat = new SubtitlesFormat() - { - Name = "SubViewer", - Extension = @"\.sub" - }; - public static SubtitlesFormat SubStationAlphaFormat = new SubtitlesFormat() - { - Name = "SubStationAlpha", - Extension = @"\.ssa" - }; - public static SubtitlesFormat TtmlFormat = new SubtitlesFormat() - { - Name = "TTML", - Extension = @"\.ttml" - }; - public static SubtitlesFormat WebVttFormat = new SubtitlesFormat() - { - Name = "WebVTT", - Extension = @"\.vtt" - }; - public static SubtitlesFormat YoutubeXmlFormat = new SubtitlesFormat() - { - Name = "YoutubeXml", - //Extension = @"\.*" - }; - - public static List SupportedSubtitlesFormats = new List() - { - SubRipFormat, - MicroDvdFormat, - SubViewerFormat, - SubStationAlphaFormat, - TtmlFormat, - WebVttFormat, - YoutubeXmlFormat - }; - - } - - -} +using System.Collections.Generic; + +namespace SubtitlesParserNew.Classes +{ + public class SubtitlesFormat + { + // Properties ----------------------------------------- + + public string Name { get; set; } + public string Extension { get; set; } + + + // Private constructor to avoid duplicates ------------ + + private SubtitlesFormat(){} + + + // Predefined instances ------------------------------- + + public static SubtitlesFormat SubRipFormat = new SubtitlesFormat() + { + Name = "SubRip", + Extension = @"\.srt" + }; + public static SubtitlesFormat MicroDvdFormat = new SubtitlesFormat() + { + Name = "MicroDvd", + Extension = @"\.sub" + }; + public static SubtitlesFormat SubViewerFormat = new SubtitlesFormat() + { + Name = "SubViewer", + Extension = @"\.sub" + }; + public static SubtitlesFormat SubStationAlphaFormat = new SubtitlesFormat() + { + Name = "SubStationAlpha", + Extension = @"\.ssa" + }; + public static SubtitlesFormat TtmlFormat = new SubtitlesFormat() + { + Name = "TTML", + Extension = @"\.ttml" + }; + public static SubtitlesFormat WebVttFormat = new SubtitlesFormat() + { + Name = "WebVTT", + Extension = @"\.vtt" + }; + public static SubtitlesFormat YoutubeXmlFormat = new SubtitlesFormat() + { + Name = "YoutubeXml", + //Extension = @"\.*" + }; + + public static List SupportedSubtitlesFormats = new List() + { + SubRipFormat, + MicroDvdFormat, + SubViewerFormat, + SubStationAlphaFormat, + TtmlFormat, + WebVttFormat, + YoutubeXmlFormat + }; + + } + + +} diff --git a/SubtitlesParserNew/SubtitlesParserNew.csproj b/SubtitlesParserNew/SubtitlesParserNew.csproj new file mode 100644 index 0000000..b290d67 --- /dev/null +++ b/SubtitlesParserNew/SubtitlesParserNew.csproj @@ -0,0 +1,7 @@ + + + + netstandard1.4 + + + diff --git a/SubtitlesParserTest.Portable/App.xaml b/SubtitlesParserTest.Portable/App.xaml new file mode 100644 index 0000000..019ba04 --- /dev/null +++ b/SubtitlesParserTest.Portable/App.xaml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/SubtitlesParserTest.Portable/App.xaml.cs b/SubtitlesParserTest.Portable/App.xaml.cs new file mode 100644 index 0000000..bf6a774 --- /dev/null +++ b/SubtitlesParserTest.Portable/App.xaml.cs @@ -0,0 +1,29 @@ +using Xamarin.Forms; + +namespace SubtitlesParserTest.Portable +{ + public partial class App : Application + { + public App() + { + InitializeComponent(); + + MainPage = new MainPage(); + } + + protected override void OnStart() + { + // Handle when your app starts + } + + protected override void OnSleep() + { + // Handle when your app sleeps + } + + protected override void OnResume() + { + // Handle when your app resumes + } + } +} \ No newline at end of file diff --git a/SubtitlesParserTest.Portable/MainPage.xaml b/SubtitlesParserTest.Portable/MainPage.xaml new file mode 100644 index 0000000..1671a48 --- /dev/null +++ b/SubtitlesParserTest.Portable/MainPage.xaml @@ -0,0 +1,14 @@ + + + + +