mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 23:49:35 -05:00
-updated to latest smplayer sources from svn.
-fixed close -disabled smplayers stylesheet to not have collision with RetroShare stylesheet in config.h -thanks to rvm he wrote a feature to can disable the stylesheet of smplayer not need more comment lines. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@385 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
172c00c2a2
commit
05ebf01ccf
@ -156,6 +156,8 @@ QString About::getTranslators() {
|
||||
trad(tr("Greek"), "my80s <wamy80s@gmail.com>") +
|
||||
trad(tr("Finnish"), "peeaivo <peeaivo@gmail.com>") +
|
||||
trad(tr("Korean"), "Heesu Yoon <imsu30@gmail.com>") +
|
||||
trad(tr("Macedonian"), "Marko Doda <mark0d0da@gmail.com>") +
|
||||
trad(tr("Basque"), "Piarres Beobide <pi@beobide.net>") +
|
||||
"</ul>");
|
||||
}
|
||||
|
||||
|
@ -1,160 +0,0 @@
|
||||
/* smplayer, GUI front-end for mplayer.
|
||||
Copyright (C) 2006-2008 Ricardo Villalba <rvm@escomposlinux.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "aboutdialog.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QTextEdit>
|
||||
#include <QPushButton>
|
||||
#include <QLayout>
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
#include "images.h"
|
||||
#include "version.h"
|
||||
|
||||
AboutDialog::AboutDialog(QWidget * parent, Qt::WindowFlags f)
|
||||
: QDialog(parent, f)
|
||||
{
|
||||
setWindowTitle( tr("About SMPlayer") );
|
||||
|
||||
logo = new QLabel(this);
|
||||
logo->setPixmap( Images::icon("logo", 64) );
|
||||
|
||||
intro = new QLabel(this);
|
||||
intro->setWordWrap(true);
|
||||
|
||||
foot = new QLabel(this);
|
||||
foot->setOpenExternalLinks(true);
|
||||
|
||||
credits = new QTextEdit(this);
|
||||
credits->setReadOnly(true);
|
||||
credits->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||
|
||||
ok_button = new QDialogButtonBox( QDialogButtonBox::Ok );
|
||||
connect( ok_button, SIGNAL(accepted()), this, SLOT(accept()) );
|
||||
|
||||
QVBoxLayout * lright = new QVBoxLayout;
|
||||
lright->addWidget( intro );
|
||||
lright->addWidget( credits );
|
||||
lright->addWidget( foot );
|
||||
|
||||
QVBoxLayout * lleft = new QVBoxLayout;
|
||||
lleft->addWidget( logo );
|
||||
lleft->addStretch(1);
|
||||
|
||||
QHBoxLayout * lmain = new QHBoxLayout;
|
||||
lmain->addLayout( lleft );
|
||||
lmain->addLayout( lright );
|
||||
|
||||
QHBoxLayout * lbutton = new QHBoxLayout;
|
||||
lbutton->addStretch(1);
|
||||
lbutton->addWidget( ok_button );
|
||||
lbutton->addStretch(1);
|
||||
|
||||
QVBoxLayout * lwidget = new QVBoxLayout(this);
|
||||
lwidget->addLayout( lmain );
|
||||
//lwidget->addWidget( foot );
|
||||
lwidget->addLayout( lbutton );
|
||||
|
||||
intro->setText(
|
||||
"<b>SMPlayer</b> © 2006-2008 RVM <rvm@escomposlinux.org><br><br>"
|
||||
"<b>" + tr("Version: %1").arg(smplayerVersion()) + "</b><br>" +
|
||||
/*
|
||||
#if KDE_SUPPORT
|
||||
tr("Compiled with KDE support") + "<br>" +
|
||||
#endif
|
||||
*/
|
||||
"<br>" +
|
||||
tr("Compiled with Qt %1").arg(QT_VERSION_STR) + "<br><br>"
|
||||
"<i>" +
|
||||
tr("This program is free software; you can redistribute it and/or modify "
|
||||
"it under the terms of the GNU General Public License as published by "
|
||||
"the Free Software Foundation; either version 2 of the License, or "
|
||||
"(at your option) any later version.") + "</i>");
|
||||
|
||||
credits->setText(
|
||||
tr("Translators:") +
|
||||
"<ul>" +
|
||||
trad(tr("German"), "Henrikx") +
|
||||
trad(tr("Slovak"), "Sweto <peter.mendel@gmail.com>") +
|
||||
trad(tr("Italian"), "Giancarlo Scola <giancarlo@codexcoop.it>") +
|
||||
trad(tr("French"), tr("%1, %2 and %3")
|
||||
.arg("Olivier g <1got@caramail.com>")
|
||||
.arg("Temet <goondy@free.fr>")
|
||||
.arg("Kud Gray <kud.gray@gmail.com>") ) +
|
||||
trad(tr("Simplified-Chinese"), "Tim Green <iamtimgreen@gmail.com>") +
|
||||
trad(tr("Russian"), tr("%1 and %2")
|
||||
.arg("Yurkovsky Andrey <anyr@tut.by>")
|
||||
.arg(QString::fromUtf8("Белый Владимир <wiselord1983@gmail.com>")))+
|
||||
trad(tr("Hungarian"), "Charles Barcza <kbarcza@blackpanther.hu>") +
|
||||
trad(tr("Polish"), tr("%1 and %2")
|
||||
.arg("qla <qla0@vp.pl>")
|
||||
.arg("Jarek <ajep9691@wp.pl>") ) +
|
||||
trad(tr("Japanese"), "Nardog <nardog@e2umail.com>") +
|
||||
trad(tr("Dutch"), "Wesley S. <wesley@ubuntu-nl.org>") +
|
||||
trad(tr("Ukrainian"), "Motsyo Gennadi <drool@altlinux.ru>") +
|
||||
trad(tr("Portuguese - Brazil"), "Ventura <ventura.barbeiro@terra.com.br>") +
|
||||
trad(tr("Georgian"), "George Machitidze <giomac@gmail.com>") +
|
||||
trad(tr("Czech"), QString::fromUtf8("Martin Dvořák <martin.dvorak@centrum.cz>")) +
|
||||
trad(tr("Bulgarian"), "<marzeliv@mail.bg>") +
|
||||
trad(tr("Turkish"), "alper er <alperer@gmail.com>") +
|
||||
trad(tr("Swedish"), "Leif Larsson <leif.larsson@gmail.com>") +
|
||||
trad(tr("Serbian"), "Kunalagon Umuhanik <kunalagon@gmail.com>") +
|
||||
trad(tr("Traditional Chinese"), "Hoopoe <dai715.tw@yahoo.com.tw>") +
|
||||
trad(tr("Romanian"), "DoruH <doruhushhush@hotmail.com>") +
|
||||
trad(tr("Portuguese - Portugal"), "Waxman <waxman.pt@gmail.com>") +
|
||||
trad(tr("Greek"), "my80s <wamy80s@gmail.com>") +
|
||||
trad(tr("Finnish"), "peeaivo <peeaivo@gmail.com>") +
|
||||
"</ul>" +
|
||||
tr("Logo designed by %1").arg("Charles Barcza <kbarcza@blackpanther.hu>") +
|
||||
"<br>"
|
||||
);
|
||||
|
||||
QString url;
|
||||
/*
|
||||
#ifdef Q_OS_WIN
|
||||
url = tr("http://smplayer.sourceforge.net/en/windows/download.php",
|
||||
"If the web page is translated into your language you can "
|
||||
"change the URL so it points to the download page in the translation."
|
||||
"Otherwise leave as is.");
|
||||
#else
|
||||
url = tr("http://smplayer.sourceforge.net/en/linux/download.php",
|
||||
"If the web page is translated into your language you can "
|
||||
"change the URL so it points to the download page in the translation."
|
||||
"Otherwise leave as is.");
|
||||
#endif
|
||||
*/
|
||||
url = "http://smplayer.sourceforge.net";
|
||||
foot->setText(
|
||||
tr("Get updates at: %1")
|
||||
.arg("<br><a href=\"" + url + "\">" + url +"</a>") );
|
||||
|
||||
/*
|
||||
adjustSize();
|
||||
setFixedSize( sizeHint() );
|
||||
*/
|
||||
}
|
||||
|
||||
AboutDialog::~AboutDialog() {
|
||||
}
|
||||
|
||||
QString AboutDialog::trad(const QString & lang, const QString & author) {
|
||||
return "<li>"+ tr("<b>%1</b>: %2").arg(lang).arg(author) + "</li>";
|
||||
}
|
||||
|
||||
#include "moc_aboutdialog.cpp"
|
@ -1,54 +0,0 @@
|
||||
/* smplayer, GUI front-end for mplayer.
|
||||
Copyright (C) 2006-2008 Ricardo Villalba <rvm@escomposlinux.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef _ABOUTDIALOG_H_
|
||||
#define _ABOUTDIALOG_H_
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class QLabel;
|
||||
class QTextEdit;
|
||||
class QDialogButtonBox;
|
||||
|
||||
//! Shows the about smplayer dialog
|
||||
|
||||
/*!
|
||||
Displays copyright info, license, translators...
|
||||
*/
|
||||
|
||||
class AboutDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AboutDialog( QWidget * parent = 0, Qt::WindowFlags f = 0 );
|
||||
~AboutDialog();
|
||||
|
||||
protected:
|
||||
//! Return a formated string with the translator and language
|
||||
QString trad(const QString & lang, const QString & author);
|
||||
|
||||
QLabel * logo;
|
||||
QLabel * intro;
|
||||
QLabel * foot;
|
||||
QTextEdit * credits;
|
||||
QDialogButtonBox * ok_button;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -57,6 +57,7 @@
|
||||
#include "inputurl.h"
|
||||
#include "recents.h"
|
||||
#include "about.h"
|
||||
#include "errordialog.h"
|
||||
#include "clhelp.h"
|
||||
|
||||
#include "config.h"
|
||||
@ -165,7 +166,7 @@ void BaseGui::initializeGui() {
|
||||
if (pref->stay_on_top) toggleStayOnTop(TRUE);
|
||||
toggleFrameCounter( pref->show_frame_counter );
|
||||
|
||||
#if QT_VERSION >= 0x040200
|
||||
#if ALLOW_CHANGE_STYLESHEET
|
||||
changeStyleSheet(pref->iconset);
|
||||
#endif
|
||||
|
||||
@ -684,6 +685,9 @@ void BaseGui::createActions() {
|
||||
doubleSizeAct = new MyAction( Qt::CTRL | Qt::Key_D, this, "toggle_double_size");
|
||||
connect( doubleSizeAct, SIGNAL(triggered()), core, SLOT(toggleDoubleSize()) );
|
||||
|
||||
resetVideoEqualizerAct = new MyAction( this, "reset_video_equalizer");
|
||||
connect( resetVideoEqualizerAct, SIGNAL(triggered()), equalizer, SLOT(reset()) );
|
||||
|
||||
// Group actions
|
||||
|
||||
// OSD
|
||||
@ -769,6 +773,16 @@ void BaseGui::createActions() {
|
||||
connect( aspectGroup, SIGNAL(activated(int)),
|
||||
core, SLOT(changeAspectRatio(int)) );
|
||||
|
||||
// Rotate
|
||||
rotateGroup = new MyActionGroup(this);
|
||||
rotateNoneAct = new MyActionGroupItem(this, rotateGroup, "rotate_none", MediaSettings::NoRotate);
|
||||
rotateClockwiseFlipAct = new MyActionGroupItem(this, rotateGroup, "rotate_clockwise_flip", MediaSettings::Clockwise_flip);
|
||||
rotateClockwiseAct = new MyActionGroupItem(this, rotateGroup, "rotate_clockwise", MediaSettings::Clockwise);
|
||||
rotateCounterclockwiseAct = new MyActionGroupItem(this, rotateGroup, "rotate_counterclockwise", MediaSettings::Counterclockwise);
|
||||
rotateCounterclockwiseFlipAct = new MyActionGroupItem(this, rotateGroup, "rotate_counterclockwise_flip", MediaSettings::Counterclockwise_flip);
|
||||
connect( rotateGroup, SIGNAL(activated(int)),
|
||||
core, SLOT(changeRotate(int)) );
|
||||
|
||||
// Audio track
|
||||
audioTrackGroup = new MyActionGroup(this);
|
||||
connect( audioTrackGroup, SIGNAL(activated(int)),
|
||||
@ -891,6 +905,7 @@ void BaseGui::setActionsEnabled(bool b) {
|
||||
sizeGroup->setActionsEnabled(b);
|
||||
deinterlaceGroup->setActionsEnabled(b);
|
||||
aspectGroup->setActionsEnabled(b);
|
||||
rotateGroup->setActionsEnabled(b);
|
||||
channelsGroup->setActionsEnabled(b);
|
||||
stereoGroup->setActionsEnabled(b);
|
||||
}
|
||||
@ -936,7 +951,6 @@ void BaseGui::enableActionsOnPlaying() {
|
||||
addLetterboxAct->setEnabled(false);
|
||||
#endif
|
||||
upscaleAct->setEnabled(false);
|
||||
|
||||
doubleSizeAct->setEnabled(false);
|
||||
|
||||
// Moving and zoom
|
||||
@ -952,6 +966,7 @@ void BaseGui::enableActionsOnPlaying() {
|
||||
sizeGroup->setActionsEnabled(false);
|
||||
deinterlaceGroup->setActionsEnabled(false);
|
||||
aspectGroup->setActionsEnabled(false);
|
||||
rotateGroup->setActionsEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1129,6 +1144,7 @@ void BaseGui::retranslateStrings() {
|
||||
nextChapterAct->change( tr("Next chapter") );
|
||||
prevChapterAct->change( tr("Previous chapter") );
|
||||
doubleSizeAct->change( tr("&Toggle double size") );
|
||||
resetVideoEqualizerAct->change( tr("Reset video equalizer") );
|
||||
|
||||
// Action groups
|
||||
osdNoneAct->change( tr("&Disabled") );
|
||||
@ -1183,6 +1199,9 @@ void BaseGui::retranslateStrings() {
|
||||
videofilter_menu->menuAction()->setText( tr("F&ilters") );
|
||||
videofilter_menu->menuAction()->setIcon( Images::icon("video_filters") );
|
||||
|
||||
rotate_menu->menuAction()->setText( tr("&Rotate") );
|
||||
rotate_menu->menuAction()->setIcon( Images::icon("rotate") );
|
||||
|
||||
/*
|
||||
denoise_menu->menuAction()->setText( tr("De&noise") );
|
||||
denoise_menu->menuAction()->setIcon( Images::icon("denoise") );
|
||||
@ -1213,6 +1232,12 @@ void BaseGui::retranslateStrings() {
|
||||
denoiseNormalAct->change( tr("Denoise nor&mal") );
|
||||
denoiseSoftAct->change( tr("Denoise &soft") );
|
||||
|
||||
rotateNoneAct->change( tr("&Off") );
|
||||
rotateClockwiseFlipAct->change( tr("&Rotate by 90 degrees clockwise and flip") );
|
||||
rotateClockwiseAct->change( tr("Rotate by 90 degrees &clockwise") );
|
||||
rotateCounterclockwiseAct->change( tr("Rotate by 90 degrees counterclock&wise") );
|
||||
rotateCounterclockwiseFlipAct->change( tr("Rotate by 90 degrees counterclockwise and &flip") );
|
||||
|
||||
// Menu Audio
|
||||
audiotrack_menu->menuAction()->setText( tr("&Track") );
|
||||
audiotrack_menu->menuAction()->setIcon( Images::icon("audio_track") );
|
||||
@ -1348,6 +1373,12 @@ void BaseGui::createCore() {
|
||||
connect( core, SIGNAL(failedToParseMplayerVersion(QString)),
|
||||
this, SLOT(askForMplayerVersion(QString)) );
|
||||
|
||||
connect( core, SIGNAL(mplayerFailed(QProcess::ProcessError)),
|
||||
this, SLOT(showErrorFromMplayer(QProcess::ProcessError)) );
|
||||
|
||||
connect( core, SIGNAL(mplayerFinishedWithError(int)),
|
||||
this, SLOT(showExitCodeFromMplayer(int)) );
|
||||
|
||||
// Hide mplayer window
|
||||
connect( core, SIGNAL(noVideo()),
|
||||
this, SLOT(hidePanel()) );
|
||||
@ -1355,7 +1386,9 @@ void BaseGui::createCore() {
|
||||
|
||||
void BaseGui::createMplayerWindow() {
|
||||
mplayerwindow = new MplayerWindow( panel );
|
||||
#if USE_COLORKEY
|
||||
mplayerwindow->setColorKey( pref->color_key );
|
||||
#endif
|
||||
mplayerwindow->allowVideoMovement( pref->allow_video_movement );
|
||||
|
||||
QHBoxLayout * layout = new QHBoxLayout;
|
||||
@ -1562,6 +1595,12 @@ void BaseGui::createMenus() {
|
||||
videoMenu->addMenu(denoise_menu);
|
||||
*/
|
||||
|
||||
// Rotate submenu
|
||||
rotate_menu = new QMenu(this);
|
||||
rotate_menu->addActions(rotateGroup->actions());
|
||||
|
||||
videoMenu->addMenu(rotate_menu);
|
||||
|
||||
videoMenu->addAction(flipAct);
|
||||
videoMenu->addSeparator();
|
||||
videoMenu->addAction(equalizerAct);
|
||||
@ -1719,8 +1758,8 @@ void BaseGui::closeWindow() {
|
||||
qDebug("BaseGui::closeWindow");
|
||||
|
||||
core->stop();
|
||||
//qApp->closeAllWindows();
|
||||
//qApp->quit();
|
||||
//emit quitSolicited();
|
||||
hide();
|
||||
}
|
||||
|
||||
@ -1796,9 +1835,9 @@ void BaseGui::applyNewPreferences() {
|
||||
if (_interface->iconsetChanged()) {
|
||||
need_update_language = true;
|
||||
// Stylesheet
|
||||
#if QT_VERSION >= 0x040200
|
||||
#if ALLOW_CHANGE_STYLESHEET
|
||||
changeStyleSheet(pref->iconset);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!pref->use_single_instance && server->isListening()) {
|
||||
@ -1825,9 +1864,11 @@ void BaseGui::applyNewPreferences() {
|
||||
if (advanced->clearingBackgroundChanged()) {
|
||||
mplayerwindow->videoLayer()->allowClearingBackground(pref->always_clear_video_background);
|
||||
}
|
||||
#if USE_COLORKEY
|
||||
if (advanced->colorkeyChanged()) {
|
||||
mplayerwindow->setColorKey( pref->color_key );
|
||||
}
|
||||
#endif
|
||||
if (advanced->monitorAspectChanged()) {
|
||||
mplayerwindow->setMonitorAspect( pref->monitor_aspect_double() );
|
||||
}
|
||||
@ -2162,6 +2203,9 @@ void BaseGui::updateWidgets() {
|
||||
// Aspect ratio
|
||||
aspectGroup->setChecked( core->mset.aspect_ratio_id );
|
||||
|
||||
// Rotate
|
||||
rotateGroup->setChecked( core->mset.rotate );
|
||||
|
||||
// OSD
|
||||
osdGroup->setChecked( pref->osd );
|
||||
|
||||
@ -2284,6 +2328,9 @@ void BaseGui::updateWidgets() {
|
||||
// Enable or disable subtitle options
|
||||
bool e = ((core->mset.current_sub_id != MediaSettings::SubNone) &&
|
||||
(core->mset.current_sub_id != MediaSettings::NoneSelected));
|
||||
|
||||
if (pref->use_closed_caption_subs) e = true; // Enable if using closed captions
|
||||
|
||||
decSubDelayAct->setEnabled(e);
|
||||
incSubDelayAct->setEnabled(e);
|
||||
decSubPosAct->setEnabled(e);
|
||||
@ -3315,6 +3362,7 @@ void BaseGui::checkMousePos(QPoint p) {
|
||||
}
|
||||
}
|
||||
|
||||
#if ALLOW_CHANGE_STYLESHEET
|
||||
void BaseGui::loadQss(QString filename) {
|
||||
QFile file( filename );
|
||||
file.open(QFile::ReadOnly);
|
||||
@ -3341,6 +3389,7 @@ void BaseGui::changeStyleSheet(QString style) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void BaseGui::loadActions() {
|
||||
qDebug("BaseGui::loadActions");
|
||||
@ -3404,6 +3453,32 @@ void BaseGui::askForMplayerVersion(QString line) {
|
||||
}
|
||||
}
|
||||
|
||||
void BaseGui::showExitCodeFromMplayer(int exit_code) {
|
||||
qDebug("BaseGui::showExitCodeFromMplayer: %d", exit_code);
|
||||
|
||||
if (exit_code != 255 ) {
|
||||
ErrorDialog d(this);
|
||||
d.setText(tr("MPlayer has finished unexpectedly.") + " " +
|
||||
tr("Exit code: %1").arg(exit_code));
|
||||
d.setLog( core->mplayer_log );
|
||||
d.exec();
|
||||
}
|
||||
}
|
||||
|
||||
void BaseGui::showErrorFromMplayer(QProcess::ProcessError e) {
|
||||
if ((e == QProcess::FailedToStart) || (e == QProcess::Crashed)) {
|
||||
ErrorDialog d(this);
|
||||
if (e == QProcess::FailedToStart) {
|
||||
d.setText(tr("MPlayer failed to start.") + " " +
|
||||
tr("Please check the MPlayer path in preferences."));
|
||||
} else {
|
||||
d.setText(tr("MPlayer has crashed.") + " " +
|
||||
tr("See the log for more info."));
|
||||
}
|
||||
d.setLog( core->mplayer_log );
|
||||
d.exec();
|
||||
}
|
||||
}
|
||||
|
||||
// Language change stuff
|
||||
void BaseGui::changeEvent(QEvent *e) {
|
||||
|
@ -186,9 +186,14 @@ protected slots:
|
||||
//! version supplied by the user
|
||||
void askForMplayerVersion(QString);
|
||||
|
||||
void showExitCodeFromMplayer(int exit_code);
|
||||
void showErrorFromMplayer(QProcess::ProcessError);
|
||||
|
||||
// stylesheet
|
||||
#if ALLOW_CHANGE_STYLESHEET
|
||||
virtual void loadQss(QString filename);
|
||||
virtual void changeStyleSheet(QString style);
|
||||
#endif
|
||||
|
||||
#if NEW_RESIZE_CODE
|
||||
void calculateDiff(); //!< Updates diff_size
|
||||
@ -215,6 +220,9 @@ signals:
|
||||
void middleClicked();
|
||||
*/
|
||||
|
||||
//! Sent when the user wants to close the main window
|
||||
void quitSolicited();
|
||||
|
||||
protected:
|
||||
virtual void retranslateStrings();
|
||||
virtual void changeEvent(QEvent * event);
|
||||
@ -369,6 +377,7 @@ protected:
|
||||
MyAction * nextChapterAct;
|
||||
MyAction * prevChapterAct;
|
||||
MyAction * doubleSizeAct;
|
||||
MyAction * resetVideoEqualizerAct;
|
||||
|
||||
// Moving and zoom
|
||||
MyAction * moveUpAct;
|
||||
@ -429,6 +438,14 @@ protected:
|
||||
MyAction * aspect43To169Act;
|
||||
#endif
|
||||
|
||||
// Rotate Group
|
||||
MyActionGroup * rotateGroup;
|
||||
MyAction * rotateNoneAct;
|
||||
MyAction * rotateClockwiseFlipAct;
|
||||
MyAction * rotateClockwiseAct;
|
||||
MyAction * rotateCounterclockwiseAct;
|
||||
MyAction * rotateCounterclockwiseFlipAct;
|
||||
|
||||
// Audio Channels Action Group
|
||||
MyActionGroup * channelsGroup;
|
||||
/* MyAction * channelsDefaultAct; */
|
||||
@ -442,13 +459,14 @@ protected:
|
||||
MyAction * leftChannelAct;
|
||||
MyAction * rightChannelAct;
|
||||
|
||||
// Audio Track Group
|
||||
// Other groups
|
||||
MyActionGroup * audioTrackGroup;
|
||||
MyActionGroup * subtitleTrackGroup;
|
||||
MyActionGroup * titleGroup;
|
||||
MyActionGroup * angleGroup;
|
||||
MyActionGroup * chapterGroup;
|
||||
|
||||
|
||||
// MENUS
|
||||
QMenu *openMenu;
|
||||
QMenu *playMenu;
|
||||
@ -477,6 +495,7 @@ protected:
|
||||
QMenu * audiofilter_menu;
|
||||
QMenu * logs_menu;
|
||||
QMenu * panscan_menu;
|
||||
QMenu * rotate_menu;
|
||||
|
||||
QMenu * popup;
|
||||
QMenu * recentfiles_menu;
|
||||
|
@ -242,7 +242,10 @@ void BaseGuiPlus::trayIconActivated(QSystemTrayIcon::ActivationReason reason) {
|
||||
}
|
||||
|
||||
void BaseGuiPlus::toggleShowAll() {
|
||||
showAll( !isVisible() );
|
||||
// Ignore if tray is not visible
|
||||
if (tray->isVisible()) {
|
||||
showAll( !isVisible() );
|
||||
}
|
||||
}
|
||||
|
||||
void BaseGuiPlus::showAll(bool b) {
|
||||
|
@ -53,6 +53,12 @@
|
||||
#define STYLE_SWITCHING 1
|
||||
|
||||
|
||||
// ALLOW_CHANGE_STYLESHEET
|
||||
// if 1, the app stylesheet can be changed
|
||||
|
||||
#define ALLOW_CHANGE_STYLESHEET 0
|
||||
|
||||
|
||||
// New code to resize the main window
|
||||
|
||||
#define NEW_RESIZE_CODE 1
|
||||
@ -98,6 +104,11 @@
|
||||
#define SCALE_ASS_SUBS 1
|
||||
|
||||
|
||||
// Just for testing, possibility to disable the use of the colorkey
|
||||
|
||||
#define USE_COLORKEY 1
|
||||
|
||||
|
||||
// Testing with a QGLWidget (for Windows)
|
||||
#define USE_GL_WIDGET 0
|
||||
|
||||
|
@ -66,6 +66,13 @@ Core::Core( MplayerWindow *mpw, QWidget* parent )
|
||||
|
||||
proc = new MplayerProcess(this);
|
||||
|
||||
// Do this the first
|
||||
connect( proc, SIGNAL(processExited()),
|
||||
mplayerwindow->videoLayer(), SLOT(playingStopped()) );
|
||||
|
||||
connect( proc, SIGNAL(error(QProcess::ProcessError)),
|
||||
mplayerwindow->videoLayer(), SLOT(playingStopped()) );
|
||||
|
||||
connect( proc, SIGNAL(receivedCurrentSec(double)),
|
||||
this, SLOT(changeCurrentSec(double)) );
|
||||
|
||||
@ -129,14 +136,15 @@ Core::Core( MplayerWindow *mpw, QWidget* parent )
|
||||
connect( this, SIGNAL(stateChanged(Core::State)),
|
||||
this, SLOT(watchState(Core::State)) );
|
||||
|
||||
connect( proc, SIGNAL(error(QProcess::ProcessError)),
|
||||
this, SIGNAL(mplayerFailed(QProcess::ProcessError)) );
|
||||
|
||||
//pref->load();
|
||||
mset.reset();
|
||||
|
||||
// Mplayerwindow
|
||||
connect( this, SIGNAL(aboutToStartPlaying()),
|
||||
mplayerwindow->videoLayer(), SLOT(playingStarted()) );
|
||||
connect( proc, SIGNAL(processExited()),
|
||||
mplayerwindow->videoLayer(), SLOT(playingStopped()) );
|
||||
|
||||
mplayerwindow->videoLayer()->allowClearingBackground(pref->always_clear_video_background);
|
||||
mplayerwindow->setMonitorAspect( pref->monitor_aspect_double() );
|
||||
@ -929,10 +937,10 @@ void Core::processFinished()
|
||||
//emit stateChanged(state());
|
||||
}
|
||||
|
||||
int exit_status = proc->exitStatus();
|
||||
qDebug(" exit_status: %d", exit_status);
|
||||
if (exit_status != 0) {
|
||||
emit mplayerFinishedWithError(exit_status);
|
||||
int exit_code = proc->exitCode();
|
||||
qDebug("Core::processFinished: exit_code: %d", exit_code);
|
||||
if (exit_code != 0) {
|
||||
emit mplayerFinishedWithError(exit_code);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1029,8 +1037,12 @@ void Core::startMplayer( QString file, double seek ) {
|
||||
|
||||
proc->addArgument("-noquiet");
|
||||
|
||||
// No mplayer fullscreen mode
|
||||
proc->addArgument("-nofs");
|
||||
if (pref->fullscreen && pref->use_mplayer_window) {
|
||||
proc->addArgument("-fs");
|
||||
} else {
|
||||
// No mplayer fullscreen mode
|
||||
proc->addArgument("-nofs");
|
||||
}
|
||||
|
||||
// Demuxer and audio and video codecs:
|
||||
if (!mset.forced_demuxer.isEmpty()) {
|
||||
@ -1177,14 +1189,21 @@ void Core::startMplayer( QString file, double seek ) {
|
||||
if (!pref->use_mplayer_window) {
|
||||
proc->addArgument("-wid");
|
||||
proc->addArgument( QString::number( (int) mplayerwindow->videoLayer()->winId() ) );
|
||||
|
||||
proc->addArgument("-colorkey");
|
||||
//proc->addArgument( "0x"+QString::number(pref->color_key, 16) );
|
||||
proc->addArgument( Helper::colorToRGB(pref->color_key) );
|
||||
|
||||
// Set monitoraspect to desktop aspect
|
||||
proc->addArgument("-monitoraspect");
|
||||
proc->addArgument( QString::number( DesktopInfo::desktop_aspectRatio(mplayerwindow) ) );
|
||||
#if USE_COLORKEY
|
||||
if (pref->vo == "directx") {
|
||||
proc->addArgument("-colorkey");
|
||||
//proc->addArgument( "0x"+QString::number(pref->color_key, 16) );
|
||||
proc->addArgument( Helper::colorToRGB(pref->color_key) );
|
||||
} else {
|
||||
qDebug("Core::startMplayer: * not using -colorkey for %s", pref->vo.toUtf8().data());
|
||||
qDebug("Core::startMplayer: * report if you can't see the video");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Square pixels
|
||||
proc->addArgument("-monitorpixelaspect");
|
||||
proc->addArgument("1");
|
||||
} else {
|
||||
// no -wid
|
||||
if (!pref->monitor_aspect.isEmpty()) {
|
||||
@ -1442,6 +1461,12 @@ void Core::startMplayer( QString file, double seek ) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// Rotate
|
||||
if (mset.rotate != MediaSettings::NoRotate) {
|
||||
proc->addArgument( "-vf-add" );
|
||||
proc->addArgument( QString("rotate=%1").arg(mset.rotate) );
|
||||
}
|
||||
|
||||
// Denoise
|
||||
if (mset.current_denoiser != MediaSettings::NoDenoise) {
|
||||
proc->addArgument("-vf-add");
|
||||
@ -1542,9 +1567,15 @@ void Core::startMplayer( QString file, double seek ) {
|
||||
proc->addArgument("screenshot");
|
||||
}
|
||||
|
||||
if ( (pref->use_soft_video_eq) /*&& (pref->vo!="gl") && (pref->vo!="gl2")*/ ) {
|
||||
if ( (pref->use_soft_video_eq) ) {
|
||||
proc->addArgument("-vf-add");
|
||||
proc->addArgument("eq2,hue");
|
||||
QString eq_filter = "eq2,hue";
|
||||
if ( (pref->vo == "gl") || (pref->vo == "gl2")
|
||||
#ifdef Q_OS_WIN
|
||||
|| (pref->vo == "directx:noaccel")
|
||||
#endif
|
||||
) eq_filter += ",scale";
|
||||
proc->addArgument(eq_filter);
|
||||
}
|
||||
|
||||
// Audio channels
|
||||
@ -2708,6 +2739,13 @@ void Core::nextOSD() {
|
||||
changeOSD( osd );
|
||||
}
|
||||
|
||||
void Core::changeRotate(int r) {
|
||||
if (mset.rotate != r) {
|
||||
mset.rotate = r;
|
||||
restartPlay();
|
||||
}
|
||||
}
|
||||
|
||||
void Core::changeSize(int n) {
|
||||
if ( /*(n != pref->size_factor) &&*/ (!pref->use_mplayer_window) ) {
|
||||
pref->size_factor = n;
|
||||
|
@ -20,7 +20,7 @@
|
||||
#define _CORE_H_
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <QProcess> // For QProcess::ProcessError
|
||||
#include "mediadata.h"
|
||||
#include "mediasettings.h"
|
||||
#include "config.h"
|
||||
@ -207,6 +207,8 @@ public slots:
|
||||
void toggleDoubleSize();
|
||||
void changePanscan(double); // Zoom on mplayerwindow
|
||||
|
||||
void changeRotate(int r);
|
||||
|
||||
void incPanscan();
|
||||
void decPanscan();
|
||||
void resetPanscan();
|
||||
@ -289,10 +291,15 @@ signals:
|
||||
void showTime(double sec);
|
||||
void showFrame(int frame);
|
||||
void needResize(int w, int h);
|
||||
void mplayerFinishedWithError(int);
|
||||
void noVideo();
|
||||
void volumeChanged(int);
|
||||
|
||||
//! MPlayer started but finished with exit code != 0
|
||||
void mplayerFinishedWithError(int exitCode);
|
||||
|
||||
//! MPlayer didn't started or crashed
|
||||
void mplayerFailed(QProcess::ProcessError error);
|
||||
|
||||
// Resend signal from mplayerprocess:
|
||||
void failedToParseMplayerVersion(QString line_with_mplayer_version);
|
||||
|
||||
|
@ -85,14 +85,15 @@ DefaultGui::~DefaultGui() {
|
||||
saveConfig();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
void DefaultGui::closeEvent( QCloseEvent * ) {
|
||||
qDebug("DefaultGui::closeEvent");
|
||||
/*qDebug("DefaultGui::closeEvent");
|
||||
|
||||
//BaseGuiPlus::closeEvent(e);
|
||||
qDebug("w: %d h: %d", width(), height() );
|
||||
qDebug("w: %d h: %d", width(), height() );*/
|
||||
hide();
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
void DefaultGui::createActions() {
|
||||
qDebug("DefaultGui::createActions");
|
||||
@ -570,10 +571,4 @@ void DefaultGui::loadConfig() {
|
||||
updateWidgets();
|
||||
}
|
||||
|
||||
void DefaultGui::closeEvent (QCloseEvent * event)
|
||||
{
|
||||
hide();
|
||||
event->ignore();
|
||||
}
|
||||
|
||||
#include "moc_defaultgui.cpp"
|
||||
|
@ -47,7 +47,6 @@ public slots:
|
||||
//virtual void showPlaylist(bool b);
|
||||
|
||||
protected:
|
||||
void closeEvent (QCloseEvent * event);
|
||||
virtual void retranslateStrings();
|
||||
virtual QMenu * createPopupMenu();
|
||||
|
||||
@ -68,7 +67,7 @@ protected:
|
||||
virtual void aboutToExitCompactMode();
|
||||
|
||||
virtual void resizeEvent( QResizeEvent * );
|
||||
/* virtual void closeEvent( QCloseEvent * ); */
|
||||
virtual void closeEvent( QCloseEvent * );
|
||||
|
||||
protected slots:
|
||||
virtual void updateWidgets();
|
||||
|
@ -52,7 +52,7 @@ Extensions::Extensions()
|
||||
<< "mkv" << "nsv" << "ram" << "flv"
|
||||
<< "ts" << "rmvb" << "dvr-ms";
|
||||
|
||||
_audio << "mp3" << "ogg" << "wav" << "wma" << "ac3" << "ra" << "ape";
|
||||
_audio << "mp3" << "ogg" << "wav" << "wma" << "ac3" << "ra" << "ape" << "flac";
|
||||
|
||||
_subtitles << "srt" << "sub" << "ssa" << "ass" << "idx" << "txt" << "smi"
|
||||
<< "rt" << "utf" << "aqt";
|
||||
|
Binary file not shown.
BIN
retroshare-gui/src/apps/smplayer/icons-png/rotate.png
Normal file
BIN
retroshare-gui/src/apps/smplayer/icons-png/rotate.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
retroshare-gui/src/apps/smplayer/icons-png/warning.png
Normal file
BIN
retroshare-gui/src/apps/smplayer/icons-png/warning.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
@ -96,5 +96,7 @@
|
||||
<file>icons-png/cl_help.png</file>
|
||||
<file>icons-png/osd.png</file>
|
||||
<file>icons-png/angle.png</file>
|
||||
<file>icons-png/rotate.png</file>
|
||||
<file>icons-png/warning.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -16,43 +16,28 @@
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#include "defaultgui.h"
|
||||
#include "minigui.h"
|
||||
#include "helper.h"
|
||||
#include "global.h"
|
||||
#include "preferences.h"
|
||||
#include "translator.h"
|
||||
#include "version.h"
|
||||
#include "config.h"
|
||||
#include "myclient.h"
|
||||
#include "constants.h"
|
||||
#include "clhelp.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include "extensions.h"
|
||||
#include "winfileassoc.h" //required for Uninstall
|
||||
#endif
|
||||
|
||||
#include <QApplication>
|
||||
#include <QLocale>
|
||||
#include <QTranslator>
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
#include <QSettings>
|
||||
#include <QRegExp>
|
||||
#include <QFile>
|
||||
|
||||
#include "smplayer.h"
|
||||
#include "global.h"
|
||||
#include "helper.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define USE_LOCKS 1
|
||||
|
||||
using namespace Global;
|
||||
|
||||
static QRegExp rx_log;
|
||||
|
||||
void myMessageOutput( QtMsgType type, const char *msg ) {
|
||||
if ( (!pref) || (!pref->log_smplayer) ) return;
|
||||
static QRegExp rx_log;
|
||||
|
||||
rx_log.setPattern(pref->log_filter);
|
||||
if (pref) {
|
||||
if (!pref->log_smplayer) return;
|
||||
rx_log.setPattern(pref->log_filter);
|
||||
} else {
|
||||
rx_log.setPattern(".*");
|
||||
}
|
||||
|
||||
QString line = QString::fromUtf8(msg);
|
||||
switch ( type ) {
|
||||
@ -85,279 +70,93 @@ void myMessageOutput( QtMsgType type, const char *msg ) {
|
||||
}
|
||||
}
|
||||
|
||||
void showInfo() {
|
||||
QString s = QObject::tr("This is SMPlayer v. %1 running on %2")
|
||||
.arg(smplayerVersion())
|
||||
#ifdef Q_OS_LINUX
|
||||
.arg("Linux")
|
||||
#else
|
||||
#ifdef Q_OS_WIN
|
||||
.arg("Windows")
|
||||
#else
|
||||
.arg("Other OS")
|
||||
#endif
|
||||
#endif
|
||||
;
|
||||
|
||||
printf("%s\n", s.toLocal8Bit().data() );
|
||||
qDebug("%s", s.toUtf8().data() );
|
||||
qDebug("Qt v. " QT_VERSION_STR);
|
||||
|
||||
qDebug(" * application path: '%s'", Helper::appPath().toUtf8().data());
|
||||
qDebug(" * data path: '%s'", Helper::dataPath().toUtf8().data());
|
||||
qDebug(" * translation path: '%s'", Helper::translationPath().toUtf8().data());
|
||||
qDebug(" * doc path: '%s'", Helper::docPath().toUtf8().data());
|
||||
qDebug(" * themes path: '%s'", Helper::themesPath().toUtf8().data());
|
||||
qDebug(" * shortcuts path: '%s'", Helper::shortcutsPath().toUtf8().data());
|
||||
qDebug(" * smplayer home path: '%s'", Helper::appHomePath().toUtf8().data());
|
||||
qDebug(" * ini path: '%s'", Helper::iniPath().toUtf8().data());
|
||||
qDebug(" * current path: '%s'", QDir::currentPath().toUtf8().data());
|
||||
}
|
||||
|
||||
|
||||
void createHomeDirectory() {
|
||||
// Create smplayer home directories
|
||||
if (!QFile::exists(Helper::appHomePath())) {
|
||||
QDir d;
|
||||
if (!d.mkdir(Helper::appHomePath())) {
|
||||
qWarning("main: can't create %s", Helper::appHomePath().toUtf8().data());
|
||||
}
|
||||
QString s = Helper::appHomePath() + "/screenshots";
|
||||
if (!d.mkdir(s)) {
|
||||
qWarning("main: can't create %s", s.toUtf8().data());
|
||||
}
|
||||
#if USE_LOCKS
|
||||
void remove_lock(QString lock_file) {
|
||||
if (QFile::exists(lock_file)) {
|
||||
qDebug("main: removing %s", lock_file.toUtf8().data());
|
||||
QFile::remove(lock_file);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int main( int argc, char ** argv )
|
||||
{
|
||||
QApplication a( argc, argv );
|
||||
//a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
if (a.arguments().contains("-uninstall")){
|
||||
//Called by uninstaller. Will restore old associations.
|
||||
WinFileAssoc RegAssoc;
|
||||
Extensions exts;
|
||||
QStringList regExts;
|
||||
RegAssoc.GetRegisteredExtensions(exts.multimedia(), regExts);
|
||||
RegAssoc.RestoreFileAssociations(regExts);
|
||||
printf("Restored associations\n");
|
||||
return 0;
|
||||
// Sets the ini_path
|
||||
QString ini_path;
|
||||
if (QFile::exists( a.applicationDirPath() + "/smplayer.ini" ) ) {
|
||||
ini_path = a.applicationDirPath();
|
||||
qDebug("main: using existing %s", QString(ini_path + "/smplayer.ini").toUtf8().data());
|
||||
}
|
||||
QStringList args = a.arguments();
|
||||
int pos = args.indexOf("-ini-path");
|
||||
if ( pos != -1) {
|
||||
if (pos+1 < args.count()) {
|
||||
pos++;
|
||||
ini_path = args[pos];
|
||||
// Delete from list
|
||||
args.removeAt(pos);
|
||||
args.removeAt(pos-1);
|
||||
} else {
|
||||
printf("Error: expected parameter for -ini-path\r\n");
|
||||
return SMPlayer::ErrorArgument;
|
||||
}
|
||||
}
|
||||
|
||||
qInstallMsgHandler( myMessageOutput );
|
||||
|
||||
#if USE_LOCKS
|
||||
//setIniPath will be set later in global_init, but we need it here
|
||||
Helper::setIniPath(ini_path);
|
||||
|
||||
QString lock_file = Helper::iniPath() + "/smplayer_init.lock";
|
||||
qDebug("main: lock_file: %s", lock_file.toUtf8().data());
|
||||
if (QFile::exists(lock_file)) {
|
||||
qDebug("main: %s exists, waiting...", lock_file.toUtf8().data());
|
||||
// Wait 10 secs max.
|
||||
int n = 100;
|
||||
while ( n > 0) {
|
||||
Helper::msleep(100); // wait 100 ms
|
||||
if (!QFile::exists(lock_file)) break;
|
||||
n--;
|
||||
if ((n % 10) == 0) qDebug("main: waiting %d...", n);
|
||||
}
|
||||
remove_lock(lock_file);
|
||||
} else {
|
||||
// Create lock file
|
||||
QFile f(lock_file);
|
||||
if (f.open(QIODevice::WriteOnly)) {
|
||||
f.write("smplayer lock file");
|
||||
f.close();
|
||||
} else {
|
||||
qWarning("main: can't open %s for writing", lock_file.toUtf8().data());
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
QString app_path = a.applicationDirPath();
|
||||
Helper::setAppPath(app_path);
|
||||
//qDebug( "main: application path: '%s'", app_path.toUtf8().data());
|
||||
|
||||
QString ini_path="";
|
||||
QStringList files_to_play;
|
||||
QString action; // Action to be passed to running instance
|
||||
QString actions_list; // Actions to be run on startup
|
||||
bool add_to_playlist = false;
|
||||
|
||||
QString app_name = QFileInfo(a.applicationFilePath()).baseName();
|
||||
qDebug("main: app name: %s", app_name.toUtf8().data());
|
||||
// If the name is smplayer_portable, activate the -ini_path by default
|
||||
if (app_name.toLower() == "smplayer_portable") {
|
||||
ini_path = Helper::appPath();
|
||||
}
|
||||
else if (QFile::exists( Helper::appPath() + "/smplayer.ini" ) ) {
|
||||
ini_path = Helper::appPath();
|
||||
qDebug("Using existing %s", QString(Helper::appPath() + "/smplayer.ini").toUtf8().data());
|
||||
SMPlayer * smplayer = new SMPlayer(ini_path);
|
||||
SMPlayer::ExitCode c = smplayer->processArgs( args );
|
||||
if (c != SMPlayer::NoExit) {
|
||||
#if USE_LOCKS
|
||||
remove_lock(lock_file);
|
||||
#endif
|
||||
return c;
|
||||
}
|
||||
|
||||
int close_at_end = -1; // -1 = not set, 1 = true, 0 false
|
||||
int start_in_fullscreen = -1;
|
||||
bool show_help = false;
|
||||
a.connect(smplayer->gui(), SIGNAL(quitSolicited()), &a, SLOT(quit()));
|
||||
smplayer->start();
|
||||
|
||||
bool use_minigui = false;
|
||||
|
||||
// Deleted KDE code
|
||||
// ...
|
||||
|
||||
// Qt code
|
||||
int arg_init = 1;
|
||||
int arg_count = a.arguments().count();
|
||||
|
||||
bool is_playlist = false;
|
||||
|
||||
if ( arg_count > arg_init ) {
|
||||
for (int n=arg_init; n < arg_count; n++) {
|
||||
QString argument = a.arguments()[n];
|
||||
if (argument == "-ini-path") {
|
||||
//qDebug( "ini_path: %d %d", n+1, arg_count );
|
||||
ini_path = Helper::appPath();
|
||||
if (n+1 < arg_count) {
|
||||
n++;
|
||||
ini_path = a.arguments()[n];
|
||||
} else {
|
||||
printf("Error: expected parameter for -ini-path\r\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (argument == "-send-action") {
|
||||
if (n+1 < arg_count) {
|
||||
n++;
|
||||
action = a.arguments()[n];
|
||||
} else {
|
||||
printf("Error: expected parameter for -send-action\r\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (argument == "-actions") {
|
||||
if (n+1 < arg_count) {
|
||||
n++;
|
||||
actions_list = a.arguments()[n];
|
||||
} else {
|
||||
printf("Error: expected parameter for -actions\r\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (argument == "-playlist") {
|
||||
is_playlist = true;
|
||||
}
|
||||
else
|
||||
if ((argument == "--help") || (argument == "-help") ||
|
||||
(argument == "-h") || (argument == "-?") ) {
|
||||
show_help = true;
|
||||
}
|
||||
else
|
||||
if (argument == "-close-at-end") {
|
||||
close_at_end = 1;
|
||||
}
|
||||
else
|
||||
if (argument == "-no-close-at-end") {
|
||||
close_at_end = 0;
|
||||
}
|
||||
else
|
||||
if (argument == "-fullscreen") {
|
||||
start_in_fullscreen = 1;
|
||||
}
|
||||
else
|
||||
if (argument == "-no-fullscreen") {
|
||||
start_in_fullscreen = 0;
|
||||
}
|
||||
else
|
||||
if (argument == "-add-to-playlist") {
|
||||
add_to_playlist = true;
|
||||
}
|
||||
else
|
||||
if (argument == "-mini") {
|
||||
use_minigui = true;
|
||||
}
|
||||
else {
|
||||
// File
|
||||
if (QFile::exists( argument )) {
|
||||
argument = QFileInfo(argument).absoluteFilePath();
|
||||
}
|
||||
if (is_playlist) {
|
||||
argument = argument + IS_PLAYLIST_TAG;
|
||||
is_playlist = false;
|
||||
}
|
||||
files_to_play.append( argument );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ini_path.isEmpty()) createHomeDirectory();
|
||||
|
||||
global_init(ini_path);
|
||||
|
||||
qInstallMsgHandler( myMessageOutput );
|
||||
|
||||
// Application translations
|
||||
translator->load( pref->language );
|
||||
|
||||
showInfo();
|
||||
|
||||
if (show_help) {
|
||||
printf("%s\n", CLHelp::help().toLocal8Bit().data());
|
||||
return 0;
|
||||
}
|
||||
|
||||
qDebug("main: files_to_play: count: %d", files_to_play.count() );
|
||||
for (int n=0; n < files_to_play.count(); n++) {
|
||||
qDebug("main: files_to_play[%d]: '%s'", n, files_to_play[n].toUtf8().data());
|
||||
}
|
||||
|
||||
|
||||
if (pref->use_single_instance) {
|
||||
// Single instance
|
||||
MyClient *c = new MyClient(pref->connection_port);
|
||||
//c->setTimeOut(1000);
|
||||
if (c->openConnection()) {
|
||||
qDebug("main: found another instance");
|
||||
|
||||
if (!action.isEmpty()) {
|
||||
if (c->sendAction(action)) {
|
||||
qDebug("main: action passed successfully to the running instance");
|
||||
} else {
|
||||
printf("Error: action couldn't be passed to the running instance");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!files_to_play.isEmpty()) {
|
||||
if (c->sendFiles(files_to_play, add_to_playlist)) {
|
||||
qDebug("main: files sent successfully to the running instance");
|
||||
qDebug("main: exiting.");
|
||||
} else {
|
||||
qDebug("main: files couldn't be sent to another instance");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
} else {
|
||||
if (!action.isEmpty()) {
|
||||
printf("Error: no running instance found\r\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!pref->default_font.isEmpty()) {
|
||||
QFont f;
|
||||
f.fromString(pref->default_font);
|
||||
a.setFont(f);
|
||||
}
|
||||
|
||||
if (close_at_end != -1) {
|
||||
pref->close_on_finish = close_at_end;
|
||||
}
|
||||
|
||||
if (start_in_fullscreen != -1) {
|
||||
pref->start_in_fullscreen = start_in_fullscreen;
|
||||
}
|
||||
|
||||
// Changes to app path, so smplayer can find a relative mplayer path
|
||||
QDir::setCurrent(Helper::appPath());
|
||||
qDebug("main: changed working directory to app path");
|
||||
qDebug("main: current directory: %s", QDir::currentPath().toUtf8().data());
|
||||
|
||||
BaseGui * w;
|
||||
if (use_minigui)
|
||||
w = new MiniGui(0);
|
||||
else
|
||||
w = new DefaultGui(0);
|
||||
|
||||
if (!w->startHidden() || !files_to_play.isEmpty() ) w->show();
|
||||
if (!files_to_play.isEmpty()) w->openFiles(files_to_play);
|
||||
|
||||
if (!actions_list.isEmpty()) w->runActions(actions_list);
|
||||
|
||||
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
|
||||
#if USE_LOCKS
|
||||
remove_lock(lock_file);
|
||||
#endif
|
||||
|
||||
int r = a.exec();
|
||||
delete w;
|
||||
|
||||
global_end();
|
||||
delete smplayer;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -91,6 +91,7 @@ void MediaSettings::reset() {
|
||||
|
||||
starting_time = -1; // Not set yet.
|
||||
|
||||
rotate = NoRotate;
|
||||
flip = false;
|
||||
|
||||
is264andHD = false;
|
||||
@ -172,6 +173,7 @@ void MediaSettings::list() {
|
||||
|
||||
qDebug(" panscan_factor: %f", panscan_factor);
|
||||
|
||||
qDebug(" rotate: %d", rotate);
|
||||
qDebug(" flip: %d", flip);
|
||||
|
||||
qDebug(" forced_demuxer: '%s'", forced_demuxer.toUtf8().data());
|
||||
@ -255,6 +257,7 @@ void MediaSettings::save(QSettings * set) {
|
||||
|
||||
set->setValue( "panscan_factor", panscan_factor);
|
||||
|
||||
set->setValue( "rotate", rotate );
|
||||
set->setValue( "flip", flip);
|
||||
|
||||
set->setValue( "forced_demuxer", forced_demuxer);
|
||||
@ -340,6 +343,7 @@ void MediaSettings::load(QSettings * set) {
|
||||
|
||||
panscan_factor = set->value( "panscan_factor", panscan_factor).toDouble();
|
||||
|
||||
rotate = set->value( "rotate", rotate).toInt();
|
||||
flip = set->value( "flip", flip).toBool();
|
||||
|
||||
forced_demuxer = set->value( "forced_demuxer", forced_demuxer).toString();
|
||||
|
@ -48,6 +48,10 @@ public:
|
||||
enum AudioChannels { ChDefault = 0, ChStereo = 2, ChSurround = 4,
|
||||
ChFull51 = 6 };
|
||||
enum StereoMode { Stereo = 0, Left = 1, Right = 2 };
|
||||
|
||||
enum Rotate { NoRotate = -1, Clockwise_flip = 0, Clockwise = 1,
|
||||
Counterclockwise = 2, Counterclockwise_flip = 3 };
|
||||
|
||||
enum IDs { NoneSelected = -1000, SubNone = 90000 };
|
||||
|
||||
MediaSettings();
|
||||
@ -116,6 +120,7 @@ public:
|
||||
|
||||
double panscan_factor; // mplayerwindow zoom
|
||||
|
||||
int rotate;
|
||||
bool flip; //!< Flip image
|
||||
|
||||
// This a property of the video and it should be
|
||||
|
@ -34,7 +34,7 @@ MplayerProcess::MplayerProcess(QObject * parent) : MyProcess(parent)
|
||||
this, SLOT(parseLine(QByteArray)) );
|
||||
|
||||
connect( this, SIGNAL(finished(int,QProcess::ExitStatus)),
|
||||
this, SLOT(processFinished()) );
|
||||
this, SLOT(processFinished(int,QProcess::ExitStatus)) );
|
||||
|
||||
connect( this, SIGNAL(error(QProcess::ProcessError)),
|
||||
this, SLOT(gotError(QProcess::ProcessError)) );
|
||||
@ -385,9 +385,14 @@ void MplayerProcess::parseLine(QByteArray ba) {
|
||||
else
|
||||
|
||||
// Clip info
|
||||
|
||||
//QString::trimmed() is used for removing leading and trailing whitespaces
|
||||
//Some .mp3 files contain tags with starting and ending whitespaces
|
||||
//Unfortunately MPlayer gives us leading and trailing whitespaces, Winamp for example doesn't show them
|
||||
|
||||
// Name
|
||||
if (rx_clip_name.indexIn(line) > -1) {
|
||||
QString s = rx_clip_name.cap(2);
|
||||
QString s = rx_clip_name.cap(2).trimmed();
|
||||
qDebug("MplayerProcess::parseLine: clip_name: '%s'", s.toUtf8().data());
|
||||
md.clip_name = s;
|
||||
}
|
||||
@ -395,7 +400,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
|
||||
|
||||
// Artist
|
||||
if (rx_clip_artist.indexIn(line) > -1) {
|
||||
QString s = rx_clip_artist.cap(1);
|
||||
QString s = rx_clip_artist.cap(1).trimmed();
|
||||
qDebug("MplayerProcess::parseLine: clip_artist: '%s'", s.toUtf8().data());
|
||||
md.clip_artist = s;
|
||||
}
|
||||
@ -403,7 +408,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
|
||||
|
||||
// Author
|
||||
if (rx_clip_author.indexIn(line) > -1) {
|
||||
QString s = rx_clip_author.cap(1);
|
||||
QString s = rx_clip_author.cap(1).trimmed();
|
||||
qDebug("MplayerProcess::parseLine: clip_author: '%s'", s.toUtf8().data());
|
||||
md.clip_author = s;
|
||||
}
|
||||
@ -411,7 +416,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
|
||||
|
||||
// Album
|
||||
if (rx_clip_album.indexIn(line) > -1) {
|
||||
QString s = rx_clip_album.cap(1);
|
||||
QString s = rx_clip_album.cap(1).trimmed();
|
||||
qDebug("MplayerProcess::parseLine: clip_album: '%s'", s.toUtf8().data());
|
||||
md.clip_album = s;
|
||||
}
|
||||
@ -419,7 +424,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
|
||||
|
||||
// Genre
|
||||
if (rx_clip_genre.indexIn(line) > -1) {
|
||||
QString s = rx_clip_genre.cap(1);
|
||||
QString s = rx_clip_genre.cap(1).trimmed();
|
||||
qDebug("MplayerProcess::parseLine: clip_genre: '%s'", s.toUtf8().data());
|
||||
md.clip_genre = s;
|
||||
}
|
||||
@ -427,7 +432,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
|
||||
|
||||
// Date
|
||||
if (rx_clip_date.indexIn(line) > -1) {
|
||||
QString s = rx_clip_date.cap(2);
|
||||
QString s = rx_clip_date.cap(2).trimmed();
|
||||
qDebug("MplayerProcess::parseLine: clip_date: '%s'", s.toUtf8().data());
|
||||
md.clip_date = s;
|
||||
}
|
||||
@ -435,7 +440,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
|
||||
|
||||
// Track
|
||||
if (rx_clip_track.indexIn(line) > -1) {
|
||||
QString s = rx_clip_track.cap(1);
|
||||
QString s = rx_clip_track.cap(1).trimmed();
|
||||
qDebug("MplayerProcess::parseLine: clip_track: '%s'", s.toUtf8().data());
|
||||
md.clip_track = s;
|
||||
}
|
||||
@ -443,7 +448,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
|
||||
|
||||
// Copyright
|
||||
if (rx_clip_copyright.indexIn(line) > -1) {
|
||||
QString s = rx_clip_copyright.cap(1);
|
||||
QString s = rx_clip_copyright.cap(1).trimmed();
|
||||
qDebug("MplayerProcess::parseLine: clip_copyright: '%s'", s.toUtf8().data());
|
||||
md.clip_copyright = s;
|
||||
}
|
||||
@ -451,7 +456,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
|
||||
|
||||
// Comment
|
||||
if (rx_clip_comment.indexIn(line) > -1) {
|
||||
QString s = rx_clip_comment.cap(1);
|
||||
QString s = rx_clip_comment.cap(1).trimmed();
|
||||
qDebug("MplayerProcess::parseLine: clip_comment: '%s'", s.toUtf8().data());
|
||||
md.clip_comment = s;
|
||||
}
|
||||
@ -459,7 +464,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
|
||||
|
||||
// Software
|
||||
if (rx_clip_software.indexIn(line) > -1) {
|
||||
QString s = rx_clip_software.cap(1);
|
||||
QString s = rx_clip_software.cap(1).trimmed();
|
||||
qDebug("MplayerProcess::parseLine: clip_software: '%s'", s.toUtf8().data());
|
||||
md.clip_software = s;
|
||||
}
|
||||
@ -559,8 +564,8 @@ void MplayerProcess::parseLine(QByteArray ba) {
|
||||
}
|
||||
|
||||
// Called when the process is finished
|
||||
void MplayerProcess::processFinished() {
|
||||
qDebug("MplayerProcess::processFinished");
|
||||
void MplayerProcess::processFinished(int exitCode, QProcess::ExitStatus exitStatus) {
|
||||
qDebug("MplayerProcess::processFinished: exitCode: %d, status: %d", exitCode, (int) exitStatus);
|
||||
// Send this signal before the endoffile one, otherwise
|
||||
// the playlist will start to play next file before all
|
||||
// objects are notified that the process has exited.
|
||||
|
@ -65,7 +65,7 @@ signals:
|
||||
|
||||
protected slots:
|
||||
void parseLine(QByteArray ba);
|
||||
void processFinished();
|
||||
void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void gotError(QProcess::ProcessError);
|
||||
|
||||
protected:
|
||||
|
@ -169,9 +169,11 @@ MplayerWindow::MplayerWindow(QWidget* parent, Qt::WindowFlags f)
|
||||
MplayerWindow::~MplayerWindow() {
|
||||
}
|
||||
|
||||
#if USE_COLORKEY
|
||||
void MplayerWindow::setColorKey( QColor c ) {
|
||||
Helper::setBackgroundColor( mplayerlayer, c );
|
||||
}
|
||||
#endif
|
||||
|
||||
void MplayerWindow::retranslateStrings() {
|
||||
//qDebug("MplayerWindow::retranslateStrings");
|
||||
|
@ -122,7 +122,9 @@ public:
|
||||
void setMonitorAspect(double asp);
|
||||
void updateVideoWindow();
|
||||
|
||||
#if USE_COLORKEY
|
||||
void setColorKey(QColor c);
|
||||
#endif
|
||||
|
||||
void setOffsetX( int );
|
||||
int offsetX();
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "prefadvanced.h"
|
||||
#include "images.h"
|
||||
#include "preferences.h"
|
||||
|
||||
#include "config.h"
|
||||
#include <QColorDialog>
|
||||
|
||||
PrefAdvanced::PrefAdvanced(QWidget * parent, Qt::WindowFlags f)
|
||||
@ -32,6 +32,12 @@ PrefAdvanced::PrefAdvanced(QWidget * parent, Qt::WindowFlags f)
|
||||
shortnames_check->hide();
|
||||
#endif
|
||||
|
||||
#if !USE_COLORKEY
|
||||
colorkey_label->hide();
|
||||
colorkey_view->hide();
|
||||
changeButton->hide();
|
||||
#endif
|
||||
|
||||
// Monitor aspect
|
||||
monitoraspect_combo->addItem("Auto");
|
||||
monitoraspect_combo->addItem("4:3");
|
||||
@ -90,7 +96,9 @@ void PrefAdvanced::setData(Preferences * pref) {
|
||||
setMplayerAdditionalArguments( pref->mplayer_additional_options );
|
||||
setMplayerAdditionalVideoFilters( pref->mplayer_additional_video_filters );
|
||||
setMplayerAdditionalAudioFilters( pref->mplayer_additional_audio_filters );
|
||||
#if USE_COLORKEY
|
||||
setColorKey( pref->color_key );
|
||||
#endif
|
||||
|
||||
setLogMplayer( pref->log_mplayer );
|
||||
setLogSmplayer( pref->log_smplayer );
|
||||
@ -108,8 +116,10 @@ void PrefAdvanced::setData(Preferences * pref) {
|
||||
void PrefAdvanced::getData(Preferences * pref) {
|
||||
requires_restart = false;
|
||||
clearing_background_changed = false;
|
||||
colorkey_changed = false;
|
||||
monitor_aspect_changed = false;
|
||||
#if USE_COLORKEY
|
||||
colorkey_changed = false;
|
||||
#endif
|
||||
|
||||
if (pref->monitor_aspect != monitorAspect()) {
|
||||
pref->monitor_aspect = monitorAspect();
|
||||
@ -126,12 +136,13 @@ void PrefAdvanced::getData(Preferences * pref) {
|
||||
TEST_AND_SET(pref->mplayer_additional_options, mplayerAdditionalArguments());
|
||||
TEST_AND_SET(pref->mplayer_additional_video_filters, mplayerAdditionalVideoFilters());
|
||||
TEST_AND_SET(pref->mplayer_additional_audio_filters, mplayerAdditionalAudioFilters());
|
||||
#if USE_COLORKEY
|
||||
if (pref->color_key != colorKey()) {
|
||||
pref->color_key = colorKey();
|
||||
colorkey_changed = true;
|
||||
requires_restart = true;
|
||||
}
|
||||
|
||||
#endif
|
||||
pref->log_mplayer = logMplayer();
|
||||
pref->log_smplayer = logSmplayer();
|
||||
pref->log_filter = logFilter();
|
||||
@ -207,6 +218,7 @@ QString PrefAdvanced::mplayerAdditionalAudioFilters() {
|
||||
return mplayer_afilters_edit->text();
|
||||
}
|
||||
|
||||
#if USE_COLORKEY
|
||||
void PrefAdvanced::setColorKey(unsigned int c) {
|
||||
QString color = QString::number(c, 16);
|
||||
while (color.length() < 6) color = "0"+color;
|
||||
@ -227,6 +239,7 @@ unsigned int PrefAdvanced::colorKey() {
|
||||
|
||||
return color;
|
||||
}
|
||||
#endif
|
||||
|
||||
void PrefAdvanced::on_changeButton_clicked() {
|
||||
//bool ok;
|
||||
@ -302,6 +315,11 @@ QString PrefAdvanced::noVideoText() {
|
||||
void PrefAdvanced::createHelp() {
|
||||
clearHelp();
|
||||
|
||||
addSectionTitle(tr("Advanced"));
|
||||
|
||||
setWhatsThis(monitoraspect_combo, tr("Monitor aspect"),
|
||||
tr("Select the aspect ratio of your monitor.") );
|
||||
|
||||
setWhatsThis(log_smplayer_check, tr("Log SMPlayer output"),
|
||||
tr("If this option is checked, smplayer will store the debugging "
|
||||
"messages that smplayer outputs "
|
||||
@ -331,6 +349,14 @@ void PrefAdvanced::createHelp() {
|
||||
"For instance: <i>^Core::.*</i> will display only the lines "
|
||||
"starting with <i>Core::</i>") );
|
||||
|
||||
setWhatsThis(mplayer_use_window_check, tr("Run MPlayer in its own window"),
|
||||
tr("If you check this option, the MPlayer video window won't be "
|
||||
"embedded in SMPlayer's main window but instead it will use its "
|
||||
"own window. Note that mouse and keyboard events will be handled "
|
||||
"directly by MPlayer, that means key shortcuts and mouse clicks "
|
||||
"probably won't work as expected when the MPlayer window has the "
|
||||
"focus.") );
|
||||
|
||||
setWhatsThis(not_clear_background_check,
|
||||
tr("Don't repaint the background of the video window"),
|
||||
tr("Checking this option may reduce flickering, but it also might "
|
||||
@ -343,6 +369,35 @@ void PrefAdvanced::createHelp() {
|
||||
"SMPlayer to pass to MPlayer the short version of the filenames, "
|
||||
"and thus it will able to open them.") );
|
||||
#endif
|
||||
|
||||
#if USE_COLORKEY
|
||||
setWhatsThis(colorkey_view, tr("Colorkey"),
|
||||
tr("If you see parts of the video over any other window, you can "
|
||||
"change the colorkey to fix it. Try to select a color close to "
|
||||
"black.") );
|
||||
#endif
|
||||
|
||||
addSectionTitle(tr("Options for MPlayer"));
|
||||
|
||||
setWhatsThis(mplayer_args_edit, tr("Options"),
|
||||
tr("Here you can type options for MPlayer. Write them separated "
|
||||
"by spaces.") );
|
||||
|
||||
setWhatsThis(mplayer_vfilters_edit, tr("Video filters"),
|
||||
tr("Here you can add video filters for MPlayer. Write them separated "
|
||||
"by commas. Don't use spaces!") );
|
||||
|
||||
setWhatsThis(mplayer_afilters_edit, tr("Audio filters"),
|
||||
tr("Here you can add audio filters for MPlayer. Write them separated "
|
||||
"by commas. Don't use spaces!") );
|
||||
|
||||
addSectionTitle(tr("MPlayer language"));
|
||||
|
||||
setWhatsThis(endoffile_combo, tr("End of file"),
|
||||
tr("Select or type a regular expression for 'End of file'") );
|
||||
|
||||
setWhatsThis(novideo_combo, tr("No video"),
|
||||
tr("Select or type a regular expression for 'No video'") );
|
||||
}
|
||||
|
||||
#include "moc_prefadvanced.cpp"
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "ui_prefadvanced.h"
|
||||
#include "prefwidget.h"
|
||||
#include "config.h"
|
||||
|
||||
class Preferences;
|
||||
|
||||
@ -42,8 +43,10 @@ public:
|
||||
void getData(Preferences * pref);
|
||||
|
||||
bool clearingBackgroundChanged() { return clearing_background_changed; };
|
||||
bool colorkeyChanged() { return colorkey_changed; };
|
||||
bool monitorAspectChanged() { return monitor_aspect_changed; };
|
||||
#if USE_COLORKEY
|
||||
bool colorkeyChanged() { return colorkey_changed; };
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void createHelp();
|
||||
@ -71,8 +74,10 @@ protected:
|
||||
void setMplayerAdditionalAudioFilters(QString s);
|
||||
QString mplayerAdditionalAudioFilters();
|
||||
|
||||
#if USE_COLORKEY
|
||||
void setColorKey(unsigned int c);
|
||||
unsigned int colorKey();
|
||||
#endif
|
||||
|
||||
// Log options
|
||||
void setLogMplayer(bool b);
|
||||
@ -105,8 +110,10 @@ protected slots:
|
||||
|
||||
private:
|
||||
bool clearing_background_changed;
|
||||
bool colorkey_changed;
|
||||
bool monitor_aspect_changed;
|
||||
#if USE_COLORKEY
|
||||
bool colorkey_changed;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -212,7 +212,7 @@
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="textLabel1_23" >
|
||||
<widget class="QLabel" name="colorkey_label" >
|
||||
<property name="text" >
|
||||
<string>&Colorkey:</string>
|
||||
</property>
|
||||
|
@ -74,8 +74,9 @@ void Preferences::reset() {
|
||||
vo = "";
|
||||
ao = "";
|
||||
|
||||
#if USE_COLORKEY
|
||||
color_key = 0x020202;
|
||||
|
||||
#endif
|
||||
|
||||
dvd_device = "";
|
||||
cdrom_device = "";
|
||||
@ -290,7 +291,9 @@ void Preferences::save() {
|
||||
set->setValue("vo", vo);
|
||||
set->setValue("ao", ao);
|
||||
|
||||
#if USE_COLORKEY
|
||||
set->setValue("color_key", QString::number(color_key,16));
|
||||
#endif
|
||||
|
||||
set->setValue("fast_audio_change", fast_audio_change);
|
||||
set->setValue("fast_chapter_change", fast_chapter_change);
|
||||
@ -500,12 +503,14 @@ void Preferences::load() {
|
||||
vo = set->value("vo", vo).toString();
|
||||
ao = set->value("ao", ao).toString();
|
||||
|
||||
#if USE_COLORKEY
|
||||
bool ok;
|
||||
QString color = set->value("color_key", QString::number(color_key,16)).toString();
|
||||
unsigned int temp_color_key = color.toUInt(&ok, 16);
|
||||
if (ok)
|
||||
color_key = temp_color_key;
|
||||
//color_key = set->value("color_key", color_key).toInt();
|
||||
#endif
|
||||
|
||||
fast_audio_change = (OptionState) set->value("fast_audio_change", fast_audio_change).toInt();
|
||||
fast_chapter_change = set->value("fast_chapter_change", fast_chapter_change).toBool();
|
||||
|
@ -49,7 +49,9 @@ public:
|
||||
QString vo; // video output
|
||||
QString ao; // audio output
|
||||
|
||||
#if USE_COLORKEY
|
||||
unsigned int color_key;
|
||||
#endif
|
||||
|
||||
// Subtitles font
|
||||
bool use_fontconfig;
|
||||
|
@ -452,6 +452,8 @@ void PrefGeneral::on_selectButton_clicked() {
|
||||
void PrefGeneral::createHelp() {
|
||||
clearHelp();
|
||||
|
||||
addSectionTitle(tr("General"));
|
||||
|
||||
setWhatsThis(mplayerbin_edit, tr("MPlayer executable"),
|
||||
tr("Here you must specify the mplayer "
|
||||
"executable that smplayer will use.<br>"
|
||||
@ -489,7 +491,9 @@ void PrefGeneral::createHelp() {
|
||||
"main window is hidden. When the window is restored, play will be "
|
||||
"resumed.") );
|
||||
|
||||
// Video/audio tab
|
||||
addSectionTitle(tr("Video"));
|
||||
|
||||
// Video tab
|
||||
setWhatsThis(eq2_check, tr("Software video equalizer"),
|
||||
tr("You can check this option if video equalizer is not supported by "
|
||||
"your graphic card or the selected video output driver.<br>"
|
||||
@ -523,6 +527,8 @@ void PrefGeneral::createHelp() {
|
||||
"The screensaver will enabled again when play finishes.<br>"
|
||||
"<b>Note:</b> This option works only in X11 and Windows.") );
|
||||
|
||||
addSectionTitle(tr("Audio"));
|
||||
|
||||
setWhatsThis(softvol_check, tr("Software volume control"),
|
||||
tr("Check this option to use the software mixer, instead of "
|
||||
"using the sound card mixer.") );
|
||||
@ -540,10 +546,6 @@ void PrefGeneral::createHelp() {
|
||||
setWhatsThis(volnorm_check, tr("Volume normalization by default"),
|
||||
tr("Maximizes the volume without distorting the sound.") );
|
||||
|
||||
setWhatsThis(scaletempo_combo, tr("High speed playback without altering pitch"),
|
||||
tr("Allows to change the playback speed without altering pitch. "
|
||||
"Requires at least MPlayer dev-SVN-r24924.") );
|
||||
|
||||
setWhatsThis(change_volume_check, tr("Change volume"),
|
||||
tr("If checked, SMPlayer will remember the volume for every file "
|
||||
"and will restore it when played again. For new files the default "
|
||||
@ -571,6 +573,12 @@ void PrefGeneral::createHelp() {
|
||||
"NOTE: This option is honored by codecs (AC3 only), "
|
||||
"filters (surround) and audio output drivers (OSS at least).") );
|
||||
|
||||
setWhatsThis(scaletempo_combo, tr("High speed playback without altering pitch"),
|
||||
tr("Allows to change the playback speed without altering pitch. "
|
||||
"Requires at least MPlayer dev-SVN-r24924.") );
|
||||
|
||||
addSectionTitle(tr("Preferred audio and subtitles"));
|
||||
|
||||
setWhatsThis(audio_lang_edit, tr("Preferred audio language"),
|
||||
tr("Here you can type your preferred language for the audio streams. "
|
||||
"When a media with multiple audio streams is found, smplayer will "
|
||||
|
@ -179,6 +179,8 @@ int PrefInput::wheelFunction() {
|
||||
void PrefInput::createHelp() {
|
||||
clearHelp();
|
||||
|
||||
addSectionTitle(tr("Keyboard"));
|
||||
|
||||
setWhatsThis(actions_editor, tr("Shortcut editor"),
|
||||
tr("This table allows you to change the key shortcuts of most "
|
||||
"available actions. Double click or press enter on a item, or "
|
||||
@ -190,12 +192,17 @@ void PrefInput::createHelp() {
|
||||
"keys). If the <b>Capture</b> button is off "
|
||||
"then you could enter the full name of the key.") );
|
||||
|
||||
addSectionTitle(tr("Mouse"));
|
||||
|
||||
setWhatsThis(left_click_combo, tr("Left click"),
|
||||
tr("Select the action for left click on the mouse.") );
|
||||
|
||||
setWhatsThis(double_click_combo, tr("Double click"),
|
||||
tr("Select the action for double click on the mouse.") );
|
||||
|
||||
setWhatsThis(middle_click_combo, tr("Middle click"),
|
||||
tr("Select the action for middle click on the mouse.") );
|
||||
|
||||
setWhatsThis(wheel_function_combo, tr("Wheel function"),
|
||||
tr("Select the action for the mouse wheel.") );
|
||||
}
|
||||
|
@ -98,6 +98,7 @@ void PrefInterface::createLanguageCombo() {
|
||||
m["ja"] = tr("Japanese");
|
||||
m["ka"] = tr("Georgian");
|
||||
m["ko"] = tr("Korean");
|
||||
m["mk"] = tr("Macedonian");
|
||||
m["nl"] = tr("Dutch");
|
||||
m["pl"] = tr("Polish");
|
||||
m["pt_BR"] = tr("Portuguese - Brazil");
|
||||
@ -415,8 +416,65 @@ void PrefInterface::changeInstanceImages() {
|
||||
void PrefInterface::createHelp() {
|
||||
clearHelp();
|
||||
|
||||
addSectionTitle(tr("Interface"));
|
||||
|
||||
setWhatsThis(mainwindow_resize_combo, tr("Autoresize"),
|
||||
tr("The main window can be resized automatically. Select the option "
|
||||
"you prefer.") );
|
||||
|
||||
setWhatsThis(save_size_check, tr("Remember position and size"),
|
||||
tr("If you check this option, the position and size of the main "
|
||||
"window will be saved and restored when you run SMPlayer again.") );
|
||||
|
||||
setWhatsThis(recents_max_items_spin, tr("Recent files"),
|
||||
tr("Select the maximum number of items that will be shown in the "
|
||||
"<b>Open->Recent files</b> submenu. If you set it to 0 that "
|
||||
"menu won't be shown at all.") );
|
||||
|
||||
setWhatsThis(language_combo, tr("Language"),
|
||||
tr("Here you can change the language of the application.") );
|
||||
|
||||
setWhatsThis(iconset_combo, tr("Icon set"),
|
||||
tr("Select the icon set you prefer for the application.") );
|
||||
|
||||
setWhatsThis(style_combo, tr("Style"),
|
||||
tr("Select the style you prefer for the application.") );
|
||||
|
||||
setWhatsThis(changeFontButton, tr("Default font"),
|
||||
tr("You can change here the application's font.") );
|
||||
|
||||
addSectionTitle(tr("Seeking"));
|
||||
|
||||
setWhatsThis(seek1, tr("Short jump"),
|
||||
tr("Select the time that should be go forward or backward when you "
|
||||
"choose the %1 action.").arg(tr("short jump")) );
|
||||
|
||||
setWhatsThis(seek2, tr("Medium jump"),
|
||||
tr("Select the time that should be go forward or backward when you "
|
||||
"choose the %1 action.").arg(tr("medium jump")) );
|
||||
|
||||
setWhatsThis(seek3, tr("Long jump"),
|
||||
tr("Select the time that should be go forward or backward when you "
|
||||
"choose the %1 action.").arg(tr("long jump")) );
|
||||
|
||||
setWhatsThis(seek4, tr("Mouse wheel jump"),
|
||||
tr("Select the time that should be go forward or backward when you "
|
||||
"move the mouse wheel.") );
|
||||
|
||||
setWhatsThis(timeslider_behaviour_combo, tr("Behaviour of time slider"),
|
||||
tr("Select what to do when dragging the time slider.") );
|
||||
|
||||
addSectionTitle(tr("Instances"));
|
||||
|
||||
setWhatsThis(single_instance_check,
|
||||
tr("Use only one running instance of SMPlayer"),
|
||||
tr("Check this option if you want to use an already running instance "
|
||||
"of SMPlayer when opening other files.") );
|
||||
|
||||
setWhatsThis(server_port_spin, tr("Port"),
|
||||
tr("SMPlayer needs to listen to a port to receive commands from other "
|
||||
"instances. You can change the port in case the default one is "
|
||||
"used by another application.") );
|
||||
}
|
||||
|
||||
#include "moc_prefinterface.cpp"
|
||||
|
@ -201,6 +201,8 @@ bool PrefPerformance::useIdx() {
|
||||
void PrefPerformance::createHelp() {
|
||||
clearHelp();
|
||||
|
||||
addSectionTitle(tr("Performance"));
|
||||
|
||||
// Performance tab
|
||||
#ifdef Q_OS_WIN
|
||||
setWhatsThis(priority_combo, tr("Priority"),
|
||||
@ -224,13 +226,13 @@ void PrefPerformance::createHelp() {
|
||||
"than not doing deblocking on e.g. MPEG-2 video. But at least for "
|
||||
"high bitrate HDTV this provides a big speedup with no visible "
|
||||
"quality loss.") +"<br>"+
|
||||
tr("Possible values:") +"<ul><li>" +
|
||||
tr("<b>Enabled</b>: the loop filter is not skipped")+"</li><li>"+
|
||||
tr("Possible values:") +"<br>" +
|
||||
tr("<b>Enabled</b>: the loop filter is not skipped")+"<br>"+
|
||||
tr("<b>Skip (always)</b>: the loop filter is skipped no matter the "
|
||||
"resolution of the video")+"</li><li>"+
|
||||
"resolution of the video")+"<br>"+
|
||||
tr("<b>Skip only on HD videos</b>: the loop filter will be "
|
||||
"skipped only on videos which height is %1 or "
|
||||
"greater.").arg(pref->HD_height) +"</li></ul>" );
|
||||
"greater.").arg(pref->HD_height) +"<br>" );
|
||||
|
||||
setWhatsThis(autosync_check, tr("Audio/video auto synchronization"),
|
||||
tr("Gradually adjusts the A/V sync based on audio delay "
|
||||
@ -256,6 +258,8 @@ void PrefPerformance::createHelp() {
|
||||
"seeking (i.e. not with stdin, pipe, etc).<br> "
|
||||
"Note: the creation of the index may take some time.") );
|
||||
|
||||
addSectionTitle(tr("Cache"));
|
||||
|
||||
setWhatsThis(cache_files_spin, tr("Cache for files"),
|
||||
tr("This option specifies how much memory (in kBytes) to use when "
|
||||
"precaching a file.") );
|
||||
|
@ -290,11 +290,49 @@ void PrefSubtitles::on_borderButton_clicked() {
|
||||
void PrefSubtitles::createHelp() {
|
||||
clearHelp();
|
||||
|
||||
addSectionTitle(tr("Subtitles"));
|
||||
|
||||
setWhatsThis(font_autoload_combo, tr("Autoload"),
|
||||
tr("Select the subtitle autoload method.") );
|
||||
|
||||
setWhatsThis(font_autoload_check, tr("Select first available subtitle"),
|
||||
tr("If there are one or more subtitle tracks available, one of them "
|
||||
"will be automatically selected, usually the first one, although if "
|
||||
"one of them matches the user's preferred language that one will "
|
||||
"be used instead.") );
|
||||
|
||||
setWhatsThis(font_encoding_combo, tr("Default subtitle encoding"),
|
||||
tr("Select the encoding which will be used for subtitle files.") );
|
||||
|
||||
setWhatsThis(sub_pos_slider, tr("Subtitle position"),
|
||||
tr("This option specifies the position of the subtitles over the "
|
||||
"video window. <i>100</i> means the bottom, while <i>0</i> means "
|
||||
"the top." ) );
|
||||
|
||||
setWhatsThis(subtitles_on_screeshots_check,
|
||||
tr("Include subtitles on screenshots"),
|
||||
tr("If this option is checked, the subtitles will appear in the "
|
||||
"screenshots. Note: it may cause some troubles sometimes." ) );
|
||||
|
||||
addSectionTitle(tr("Font"));
|
||||
|
||||
setWhatsThis(ttf_font_edit, tr("TTF font"),
|
||||
tr("Here you can select a ttf font to be used for the subtitles. "
|
||||
"Usually you'll find a lot of ttf fonts in <i>%1</i>.")
|
||||
#ifdef Q_OS_WIN
|
||||
.arg("C:\\Windows\\Fonts\\")
|
||||
#else
|
||||
.arg("/usr/X11R6/lib/X11/fonts/truetype/")
|
||||
#endif
|
||||
);
|
||||
|
||||
setWhatsThis(fontCombo, tr("System font"),
|
||||
tr("Here you can select a system font to be used for the subtitles "
|
||||
"and OSD. <b>Note:</b> requires a MPlayer with fontconfig support.") );
|
||||
|
||||
setWhatsThis(font_autoscale_combo, tr("Autoscale"),
|
||||
tr("Select the subtitle autoscaling method.") );
|
||||
|
||||
setWhatsThis(font_text_scale, tr("Default scale for normal subtitles"),
|
||||
tr("This option specifies the default font scale for normal (white) "
|
||||
"subtitles which will be used for new videos."));
|
||||
@ -303,6 +341,18 @@ void PrefSubtitles::createHelp() {
|
||||
tr("This option specifies the default font scale for SSA/ASS "
|
||||
"subtitles which will be used for new videos."));
|
||||
|
||||
addSectionTitle(tr("SSA/ASS library"));
|
||||
|
||||
setWhatsThis(font_ass_check, tr("Use SSA/ASS library for subtitle rendering"),
|
||||
tr("Check this option to activate the SSA/ASS library. It provides "
|
||||
"nicer subtitles, so it's a good idea to do it.") );
|
||||
|
||||
setWhatsThis(colorButton, tr("Text color"),
|
||||
tr("Select the color for the text of the subtitles.") );
|
||||
|
||||
setWhatsThis(borderButton, tr("Border color"),
|
||||
tr("Select the color for the border of the subtitles.") );
|
||||
|
||||
setWhatsThis(ass_styles_edit, tr("SSA/ASS styles"),
|
||||
tr("Here you can override styles for SSA/ASS subtitles. "
|
||||
"It can be also used for fine-tuning the rendering of SRT and SUB "
|
||||
|
@ -37,6 +37,10 @@ QPixmap PrefWidget::sectionIcon() {
|
||||
return QPixmap();
|
||||
}
|
||||
|
||||
void PrefWidget::addSectionTitle(const QString & title) {
|
||||
help_message += "<h2>"+title+"</h2>";
|
||||
}
|
||||
|
||||
void PrefWidget::setWhatsThis( QWidget *w, const QString & title,
|
||||
const QString & text)
|
||||
{
|
||||
|
@ -51,6 +51,8 @@ protected:
|
||||
virtual void retranslateStrings();
|
||||
virtual void changeEvent ( QEvent * event ) ;
|
||||
|
||||
// Help
|
||||
void addSectionTitle(const QString & title);
|
||||
void setWhatsThis( QWidget *w, const QString & title, const QString & text);
|
||||
void clearHelp();
|
||||
|
||||
|
@ -82,15 +82,11 @@ static void initKeyMap()
|
||||
keyMap[Qt::Key_Up] = "Up";
|
||||
keyMap[Qt::Key_Right] = "Right";
|
||||
keyMap[Qt::Key_Down] = "Down";
|
||||
keyMap[Qt::Key_PageUp] = "PageUp";
|
||||
keyMap[Qt::Key_PageDown] = "PageDown";
|
||||
keyMap[Qt::Key_PageUp] = "PgUp";
|
||||
keyMap[Qt::Key_PageDown] = "PgDown";
|
||||
keyMap[Qt::Key_CapsLock] = "CapsLock";
|
||||
keyMap[Qt::Key_NumLock] = "NumLock";
|
||||
keyMap[Qt::Key_ScrollLock] = "ScrollLock";
|
||||
|
||||
// Added by rvm:
|
||||
keyMap[Qt::Key_Space] = "Space";
|
||||
keyMap[Qt::Key_Backspace] = "Backspace";
|
||||
|
||||
/*
|
||||
These one are quite sure...
|
||||
@ -202,7 +198,22 @@ static void initKeyMap()
|
||||
keyMap[Qt::Key_Bar] = "|";
|
||||
keyMap[Qt::Key_BraceRight] = "}";
|
||||
keyMap[Qt::Key_AsciiTilde] = "~";
|
||||
|
||||
|
||||
// Added by rvm:
|
||||
keyMap[Qt::Key_Space] = "Space";
|
||||
keyMap[Qt::Key_Backspace] = "Backspace";
|
||||
keyMap[Qt::Key_MediaPlay] = "Media Play";
|
||||
keyMap[Qt::Key_MediaStop] = "Media Stop";
|
||||
keyMap[Qt::Key_MediaPrevious] = "Media Previous";
|
||||
keyMap[Qt::Key_MediaNext] = "Media Next";
|
||||
keyMap[Qt::Key_MediaRecord] = "Media Record";
|
||||
keyMap[Qt::Key_MediaLast] = "Media Last"; // doesn't work?
|
||||
keyMap[Qt::Key_VolumeUp] = "Volume Up";
|
||||
keyMap[Qt::Key_VolumeDown] = "Volume Down";
|
||||
keyMap[Qt::Key_VolumeMute] = "Volume Mute";
|
||||
keyMap[Qt::Key_Back] = "Back";
|
||||
keyMap[Qt::Key_Forward] = "Forward";
|
||||
keyMap[Qt::Key_Stop] = "Stop";
|
||||
}
|
||||
|
||||
static QString keyToString(int k)
|
||||
|
@ -1,6 +1,7 @@
|
||||
TEMPLATE = lib
|
||||
CONFIG += staticlib
|
||||
TEMPLATE = lib
|
||||
CONFIG += staticlib
|
||||
DESTDIR = lib
|
||||
#TEMPLATE = app
|
||||
LANGUAGE = C++
|
||||
|
||||
CONFIG += release
|
||||
@ -68,7 +69,8 @@ HEADERS += config.h \
|
||||
filedialog.h \
|
||||
inputmplayerversion.h \
|
||||
about.h \
|
||||
basegui.h \
|
||||
errordialog.h \
|
||||
basegui.h \
|
||||
baseguiplus.h \
|
||||
floatingwidget.h \
|
||||
widgetactions.h \
|
||||
@ -132,6 +134,7 @@ SOURCES += version.cpp \
|
||||
filedialog.cpp \
|
||||
inputmplayerversion.cpp \
|
||||
about.cpp \
|
||||
errordialog.cpp \
|
||||
basegui.cpp \
|
||||
baseguiplus.cpp \
|
||||
floatingwidget.cpp \
|
||||
@ -139,13 +142,14 @@ SOURCES += version.cpp \
|
||||
defaultgui.cpp \
|
||||
minigui.cpp \
|
||||
clhelp.cpp \
|
||||
smplayer.cpp
|
||||
smplayer.cpp \
|
||||
main.cpp
|
||||
|
||||
FORMS = inputdvddirectory.ui logwindowbase.ui filepropertiesdialog.ui \
|
||||
eqslider.ui seekwidget.ui inputurl.ui \
|
||||
preferencesdialog.ui prefgeneral.ui prefdrives.ui prefinterface.ui \
|
||||
prefperformance.ui prefinput.ui prefsubtitles.ui prefadvanced.ui \
|
||||
about.ui inputmplayerversion.ui
|
||||
about.ui inputmplayerversion.ui errordialog.ui
|
||||
|
||||
TRANSLATIONS = translations/smplayer_es.ts translations/smplayer_de.ts \
|
||||
translations/smplayer_sk.ts translations/smplayer_it.ts \
|
||||
@ -159,7 +163,8 @@ TRANSLATIONS = translations/smplayer_es.ts translations/smplayer_de.ts \
|
||||
translations/smplayer_sv.ts translations/smplayer_sr.ts \
|
||||
translations/smplayer_zh_TW.ts translations/smplayer_ro_RO.ts \
|
||||
translations/smplayer_pt_PT.ts translations/smplayer_el_GR.ts \
|
||||
translations/smplayer_fi.ts translations/smplayer_ko.ts
|
||||
translations/smplayer_fi.ts translations/smplayer_ko.ts \
|
||||
translations/smplayer_mk.ts translations/smplayer_eu.ts
|
||||
|
||||
unix {
|
||||
UI_DIR = .ui
|
||||
|
@ -40,6 +40,9 @@ QString TrackData::displayName() const {
|
||||
|
||||
if (!_name.isEmpty()) {
|
||||
dname = _name;
|
||||
if (!_lang.isEmpty()) {
|
||||
dname += " ["+ _lang + "]";
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!_lang.isEmpty()) {
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -44,7 +44,7 @@ public:
|
||||
signals:
|
||||
void visibilityChanged();
|
||||
|
||||
protected slots:
|
||||
public slots:
|
||||
void reset();
|
||||
void setDefaults();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user