mfkl / LibVLCSharp-readonly

.NET bindings for LibVLC
GNU Lesser General Public License v2.1
9 stars 2 forks source link

VLC Configuration CLI flags #12

Open mfkl opened 6 years ago

mfkl commented 6 years ago

When creating a new VLC Instance object, we can pass CLI flags to it to configure VLC.

To make this more .NET-feel like, I was thinking we could use some kind of VLCConfiguration object that would encapsulate those flags (with matching documentation in comments for intellisense) in a builder pattern-like fashion, not unlike NServiceBus does it https://gist.github.com/Particular/6107912. It would then fold into an array of strings with the corresponding configuration flags before being marshalled to libvlc.

Maybe something like:

instance.Configure.With()
.EnableBluray()
.DisableSmb()
.Mad(path)
...

@jeremyVignelles thoughts?

jeremyVignelles commented 6 years ago

This would feel nice in the .net way, but I see at least 3 strong arguments against that:

Otherwise, for core options (vout...). Like .UseVout("...") and .AddSout(...). That API should be well defined before implementing

mfkl commented 6 years ago
  • Being complete requires a lot of work

I agree. Maybe only for the core/most used options for now.

  • Each time a new plugin is added, a flag is added or modified, your api is broken. the plugins do not follow the libvlc API versions

Ok that's a problem.

  • Depending on the libvlc build you are using, different flags might have been used in the configure scripts, disabling some plugins that would be available for other builds.

Sure, but you can make the same argument with regular CLI options. If you pass flags for stuff that's unavailable, whether by CLI or through this syntactic sugar, things will go wrong. This is at the user's discretion, I'm not suggesting we pass defaults that might not always be available.

jeremyVignelles commented 6 years ago

The link you pasted is misleading : it's the list of the ./configure command line, which configures the build of vlc (enables plugins...). Wvat we are talking about are runtime flags, right? For me, the best UX improvement we can provide is with sout : the sout syntax is not very clear for newcomers (including myself). For me:

mfkl commented 6 years ago

The link you pasted is misleading : it's the list of the ./configure

Ops! Fixed.

What we are talking about are runtime flags, right?

Yes.

Those are extensions method for a CliOptionsBuilder. When Build is invoked, a string[] is generated. The initialization method takes a string[] or a CliOptionBuilder to create the libvlc instance

Yep.

mfkl commented 6 years ago

https://github.com/commandlineparser/commandline