This forum is deprecated. Please visit https://github.com/smplayer-dev/smplayer/discussions

feature request: new command line parameter "-mplayer-option

Problems, bugs, suggestions... anything related to SMPlayer.

feature request: new command line parameter "-mplayer-option

Postby rogerdpack » Thu Jun 16, 2011 6:56 pm

Hello.
Currently it's basically impossible to pass things into mplayer like -edl [1]
Feature request/suggestion: add a new command line parameter that *supplements* what's in [advanced] mplayer_additional_options
Cheers!
-roger-
[1] viewtopic.php?f=2&t=540
rogerdpack
 
Posts: 12
Joined: Mon Nov 29, 2010 12:17 pm

Re: feature request: new command line parameter "-mplayer-option

Postby steep8 » Tue Aug 09, 2011 8:34 am

patch:
diff -ru -N -x '*.user' -x 'ui_*' -x release -x '*.Release' -x '*.Debug' -x debug -x Makefile -x '*.orig' -x '*.qm' -x svn_revision.h src-orig/clhelp.cpp src/clhelp.cpp
--- src-orig/clhelp.cpp 2011-03-17 07:48:24 +0000
+++ src/clhelp.cpp 2011-03-17 10:18:28 +0000
@@ -88,14 +88,16 @@
"[-use-single-instance] [-not-use-single-instance] "
"[-close-at-end] [-no-close-at-end] [-fullscreen] [-no-fullscreen] "
"[-sub %5] [-pos x y] [-size %6 %7] "
+ "[-additional-mplayer-params %8]"
"[-add-to-playlist] [-help|--help|-h|-?] "
- "[[-playlist] %8] [[-playlist] %8]...")
+ "[[-playlist] %9] [[-playlist] %9]...")
.arg(app_name)
.arg(QObject::tr("directory"))
.arg(QObject::tr("action_name"))
.arg(QObject::tr("action_list"))
.arg(QObject::tr("subtitle_file"))
.arg(QObject::tr("width")).arg(QObject::tr("height"))
+ .arg(QObject::tr("mplayer-params"))
.arg(QObject::tr("media"));

QString s;
@@ -152,6 +154,9 @@
s += formatHelp( "-no-close-at-end", QObject::tr(
"the main window won't be closed when the file/playlist finishes."), html );

+ s += formatHelp( "-additional-mplayer-params", QObject::tr(
+ "the options will directly pass to mplayer."), html );
+
s += formatHelp( "-fullscreen", QObject::tr(
"the video will be played in fullscreen mode."), html );

diff -ru -N -x '*.user' -x 'ui_*' -x release -x '*.Release' -x '*.Debug' -x debug -x Makefile -x '*.orig' -x '*.qm' -x svn_revision.h src-orig/core.cpp src/core.cpp
--- src-orig/core.cpp 2011-03-17 07:48:24 +0000
+++ src/core.cpp 2011-03-17 10:20:30 +0000
@@ -2295,6 +2295,15 @@
}
}

+ if (!pref->mplayer_additional_params.isEmpty()) {
+ QStringList args = MyProcess::splitArguments(pref->mplayer_additional_params);
+ QStringList::Iterator it = args.begin();
+ while( it != args.end() ) {
+ proc->addArgument( (*it) );
+ ++it;
+ }
+ }
+
// File to play
if (url_is_playlist) {
proc->addArgument("-playlist");
diff -ru -N -x '*.user' -x 'ui_*' -x release -x '*.Release' -x '*.Debug' -x debug -x Makefile -x '*.orig' -x '*.qm' -x svn_revision.h src-orig/preferences.cpp src/preferences.cpp
--- src-orig/preferences.cpp 2011-03-17 07:48:24 +0000
+++ src/preferences.cpp 2011-03-17 08:26:00 +0000
@@ -124,6 +124,8 @@

file_settings_method = "hash"; // Possible values: normal & hash

+ mplayer_additional_params = "";
+

/* ***************
Drives (CD/DVD)
diff -ru -N -x '*.user' -x 'ui_*' -x release -x '*.Release' -x '*.Debug' -x debug -x Makefile -x '*.orig' -x '*.qm' -x svn_revision.h src-orig/preferences.h src/preferences.h
--- src-orig/preferences.h 2011-03-17 07:48:24 +0000
+++ src/preferences.h 2011-03-17 08:25:23 +0000
@@ -125,6 +125,8 @@

QString file_settings_method; //!< Method to be used for saving file settings

+ QString mplayer_additional_params;
+

/* ***************
Drives (CD/DVD)
diff -ru -N -x '*.user' -x 'ui_*' -x release -x '*.Release' -x '*.Debug' -x debug -x Makefile -x '*.orig' -x '*.qm' -x svn_revision.h src-orig/smplayer.cpp src/smplayer.cpp
--- src-orig/smplayer.cpp 2011-03-17 07:48:24 +0000
+++ src/smplayer.cpp 2011-03-17 08:11:21 +0000
@@ -270,6 +270,16 @@
return ErrorArgument;
}
}
+ else
+ if (argument == "-mplayer-additional-params") {
+ if (n+1 < args.count()) {
+ n++;
+ Global::pref->mplayer_additional_params = args[n];
+ } else {
+ printf("Error: expected parameter for -mplayer-additional-params\r\n");
+ return ErrorArgument;
+ }
+ }
else {
// File
if (QFile::exists( argument )) {
steep8
 

Re: feature request: new command line parameter "-mplayer-op

Postby rogerdpack » Mon Aug 27, 2012 6:29 pm

Anybody know if this was every committed? ...
rogerdpack
 
Posts: 12
Joined: Mon Nov 29, 2010 12:17 pm

Re: feature request: new command line parameter "-mplayer-op

Postby rvm » Mon Aug 27, 2012 8:55 pm

No, it wasn't.
rvm
Site Admin
 
Posts: 3787
Joined: Wed Dec 23, 2009 1:25 am
Location: España

Re: feature request: new command line parameter "-mplayer-op

Postby rogerdpack » Mon Aug 27, 2012 9:00 pm

Could I get feedback on it then? What can I do to help it through :)
-roger-
rogerdpack
 
Posts: 12
Joined: Mon Nov 29, 2010 12:17 pm


Return to General

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 31 guests