dev en master hace 5 años
| private long Frame { get; set; } = 0; | private long Frame { get; set; } = 0; | ||||
| private DirectoryInfo libDirectory = new DirectoryInfo( Path.Combine( ".", "libvlc", IntPtr.Size == 4 ? "x86" : "x64" ) ); | private DirectoryInfo libDirectory = new DirectoryInfo( Path.Combine( ".", "libvlc", IntPtr.Size == 4 ? "x86" : "x64" ) ); | ||||
| public Form1() | |||||
| public Form1( string videoFile, string scriptFile ) | |||||
| { | { | ||||
| if ( !libDirectory.Exists ) libDirectory.Create(); | if ( !libDirectory.Exists ) libDirectory.Create(); | ||||
| InitializeComponent(); | InitializeComponent(); | ||||
| framesPerStep.Text = Properties.Settings.Default.FramesPerStep.ToString(); | framesPerStep.Text = Properties.Settings.Default.FramesPerStep.ToString(); | ||||
| track1.FunScript = new FunScript(); | track1.FunScript = new FunScript(); | ||||
| track1.FrameChanged += Track1_FrameChanged; | track1.FrameChanged += Track1_FrameChanged; | ||||
| if ( videoFile != null ) openVideoFile( videoFile ); | |||||
| if ( scriptFile != null ) openFunScript( scriptFile ); | |||||
| } | } | ||||
| private void Track1_FrameChanged( long frame, Track.Action sender ) | private void Track1_FrameChanged( long frame, Track.Action sender ) | ||||
| private void openVideo_Click( object sender, EventArgs e ) | private void openVideo_Click( object sender, EventArgs e ) | ||||
| { | { | ||||
| if ( ofdv.ShowDialog() == DialogResult.OK ) | if ( ofdv.ShowDialog() == DialogResult.OK ) | ||||
| { | |||||
| openVideoFile( ofdv.FileName ); | |||||
| } | |||||
| } | |||||
| private void openVideoFile( string videoFile ) | |||||
| { | { | ||||
| try | try | ||||
| { | { | ||||
| var fi = new FileInfo( ofdv.FileName ); | |||||
| VFR.Open( ofdv.FileName ); | |||||
| var fi = new FileInfo( videoFile ); | |||||
| VFR.Open( videoFile ); | |||||
| lastFrame = -1; | lastFrame = -1; | ||||
| Frame = 0; | Frame = 0; | ||||
| LoadFrame(); | LoadFrame(); | ||||
| Zip = null; | Zip = null; | ||||
| } | } | ||||
| if ( File.Exists( $"{ fname }.rawc" ) ) Zip = new ZipFile( $"{ fname }.rawc" ); | if ( File.Exists( $"{ fname }.rawc" ) ) Zip = new ZipFile( $"{ fname }.rawc" ); | ||||
| } catch ( Exception ex ) | |||||
| } | |||||
| catch ( Exception ex ) | |||||
| { | { | ||||
| MessageBox.Show( ex.Message ); | MessageBox.Show( ex.Message ); | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| private void playPause_Click( object sender, EventArgs e ) | private void playPause_Click( object sender, EventArgs e ) | ||||
| { | { |
| var fs = new FunScript(); | var fs = new FunScript(); | ||||
| foreach( var line in File.ReadAllLines( file ) ) { | foreach( var line in File.ReadAllLines( file ) ) { | ||||
| if ( line.StartsWith( "#" ) ) continue; | if ( line.StartsWith( "#" ) ) continue; | ||||
| var match = Regex.Match( line, @"([0-9\.]+),([0-9\.]+)(,.*)?", RegexOptions.Multiline ); | |||||
| var match = Regex.Match( line, @"([0-9\.]+),([0-9\.]+)(?:,.*)?", RegexOptions.Multiline ); | |||||
| if ( match.Success ) | if ( match.Success ) | ||||
| { | { | ||||
| fs.Actions.AddLast( new Action( long.Parse( match.Groups[ 0 ].Value ), int.Parse( match.Groups[ 1 ].Value ) ) ); | |||||
| try | |||||
| { | |||||
| fs.Actions.AddLast( new Action( long.Parse( match.Groups[ 1 ].Value ), int.Parse( match.Groups[ 2 ].Value ) ) ); | |||||
| } catch ( Exception ex ) | |||||
| { | |||||
| var i = 0; | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| return fs; | return fs; |
| <Deterministic>true</Deterministic> | <Deterministic>true</Deterministic> | ||||
| <NuGetPackageImportStamp> | <NuGetPackageImportStamp> | ||||
| </NuGetPackageImportStamp> | </NuGetPackageImportStamp> | ||||
| <IsWebBootstrapper>true</IsWebBootstrapper> | |||||
| <PublishUrl>ftp://dragonskills99.de/var/www/html/scripts.dragonskills99.de/projects/funscripta/</PublishUrl> | |||||
| <IsWebBootstrapper>false</IsWebBootstrapper> | |||||
| <PublishUrl>publish\</PublishUrl> | |||||
| <Install>true</Install> | <Install>true</Install> | ||||
| <InstallFrom>Web</InstallFrom> | |||||
| <UpdateEnabled>true</UpdateEnabled> | |||||
| <InstallFrom>Disk</InstallFrom> | |||||
| <UpdateEnabled>false</UpdateEnabled> | |||||
| <UpdateMode>Foreground</UpdateMode> | <UpdateMode>Foreground</UpdateMode> | ||||
| <UpdateInterval>7</UpdateInterval> | <UpdateInterval>7</UpdateInterval> | ||||
| <UpdateIntervalUnits>Days</UpdateIntervalUnits> | <UpdateIntervalUnits>Days</UpdateIntervalUnits> | ||||
| <UpdatePeriodically>false</UpdatePeriodically> | <UpdatePeriodically>false</UpdatePeriodically> | ||||
| <UpdateRequired>false</UpdateRequired> | <UpdateRequired>false</UpdateRequired> | ||||
| <MapFileExtensions>true</MapFileExtensions> | <MapFileExtensions>true</MapFileExtensions> | ||||
| <InstallUrl>http://scripts.dragonskills99.de/projects/funscripta/</InstallUrl> | |||||
| <CreateWebPageOnPublish>true</CreateWebPageOnPublish> | |||||
| <WebPage>publish.htm</WebPage> | <WebPage>publish.htm</WebPage> | ||||
| <ApplicationRevision>1</ApplicationRevision> | <ApplicationRevision>1</ApplicationRevision> | ||||
| <ApplicationVersion>1.0.0.%2a</ApplicationVersion> | <ApplicationVersion>1.0.0.%2a</ApplicationVersion> |
| namespace Funscripta | namespace Funscripta | ||||
| { | { | ||||
| static class Program | |||||
| public static class Program | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// The main entry point for the application. | /// The main entry point for the application. | ||||
| /// </summary> | /// </summary> | ||||
| [STAThread] | [STAThread] | ||||
| static void Main() | |||||
| static void Main( string[] args ) | |||||
| { | { | ||||
| args = new string[] { @"F:\VR\Animes\Lewd FRAGGY\Kantai Collection - Shimakaze Live Fire Dildo - Oculus Rift, HTC VIVE -.mp4" }; | |||||
| var _args = ParseArguments( args ); | |||||
| var video = _args.Get( "v" ); | |||||
| var script = _args.Get( "s" ); | |||||
| Application.EnableVisualStyles(); | Application.EnableVisualStyles(); | ||||
| Application.SetCompatibleTextRenderingDefault( false ); | Application.SetCompatibleTextRenderingDefault( false ); | ||||
| Application.Run( new Form1() ); | |||||
| Application.Run( new Form1( video, script ) ); | |||||
| } | |||||
| private static UnsafeDictionary<string, string> ParseArguments( string[] args ) | |||||
| { | |||||
| var _args = new UnsafeDictionary<string, string>(); | |||||
| for ( var i = 0; i < args.Length; i++ ) | |||||
| { | |||||
| var arg = args[ i ]; | |||||
| if ( i == 0 ) _args[ arg.ToLower().EndsWith( ".csv" ) || arg.ToLower().EndsWith( ".funscript" ) ? "s" : "v" ] = arg; | |||||
| if ( arg != null && arg.StartsWith( "-" ) && ( i + 1 ) < args.Length ) _args[ arg.Substring( 1 ).ToLower() ] = args[ i + 1 ]; | |||||
| } | |||||
| return _args; | |||||
| } | } | ||||
| public static void MayInvoke( this Control c, Action a ) | public static void MayInvoke( this Control c, Action a ) | ||||
| var mod = Math.Pow( 10, decimals ); | var mod = Math.Pow( 10, decimals ); | ||||
| return Math.Round( f * mod ) / mod; | return Math.Round( f * mod ) / mod; | ||||
| } | } | ||||
| public class UnsafeDictionary<T, U> : Dictionary<T, U> where U : class | |||||
| { | |||||
| public U Get( T key ) | |||||
| { | |||||
| if ( this.ContainsKey( key ) ) return this[ key ]; | |||||
| else return null; | |||||
| } | |||||
| public U GetOrDefault( T key, U def ) | |||||
| { | |||||
| if ( this.ContainsKey( key ) ) return this[ key ]; | |||||
| else return def; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| } | } |
| A little Windows Application for creating funscript files and/or converting them to the corresponding csv format. | A little Windows Application for creating funscript files and/or converting them to the corresponding csv format. | ||||
| You can now open a script or video-file directly via drag 'n drop, send the file as first parameter or send a video file prefixed with `-v` and/or a script file prefixed with `-s` in cmd as parameter. | |||||
| Prefixed parameters will take priority over the first parameter. | |||||
| e.g.: | |||||
| `Funscripta.exe "C:\MyVideos\MyNiceVideo.mp4"` or | |||||
| `Funscripta.exe -v "C:\MyVideos\MyNiceVideo.mp4"` or | |||||
| `Funscripta.exe -s "C:\MyVideos\MyNiceVideo.csv"` or | |||||
| `Funscripta.exe -v "C:\MyVideos\MyNiceVideo.mp4" -s "C:\MyScripts\MyNiceVideo.csv"` | |||||
| <div>Icons erstellt von <a href="https://www.flaticon.com/de/autoren/smashicons" title="Smashicons">Smashicons</a> from <a href="https://www.flaticon.com/de/" title="Flaticon">www.flaticon.com</a></div> | <div>Icons erstellt von <a href="https://www.flaticon.com/de/autoren/smashicons" title="Smashicons">Smashicons</a> from <a href="https://www.flaticon.com/de/" title="Flaticon">www.flaticon.com</a></div> | ||||