-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:
defnax 2008-03-18 23:13:09 +00:00
parent 172c00c2a2
commit 05ebf01ccf
65 changed files with 26341 additions and 14870 deletions

View file

@ -156,6 +156,8 @@ QString About::getTranslators() {
trad(tr("Greek"), "my80s <wamy80s@gmail.com>") + trad(tr("Greek"), "my80s <wamy80s@gmail.com>") +
trad(tr("Finnish"), "peeaivo <peeaivo@gmail.com>") + trad(tr("Finnish"), "peeaivo <peeaivo@gmail.com>") +
trad(tr("Korean"), "Heesu Yoon <imsu30@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>"); "</ul>");
} }

View file

@ -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> &copy; 2006-2008 RVM &lt;rvm@escomposlinux.org&gt;<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 &lt;peter.mendel@gmail.com&gt;") +
trad(tr("Italian"), "Giancarlo Scola &lt;giancarlo@codexcoop.it&gt;") +
trad(tr("French"), tr("%1, %2 and %3")
.arg("Olivier g &lt;1got@caramail.com&gt;")
.arg("Temet &lt;goondy@free.fr&gt;")
.arg("Kud Gray &lt;kud.gray@gmail.com&gt;") ) +
trad(tr("Simplified-Chinese"), "Tim Green &lt;iamtimgreen@gmail.com&gt;") +
trad(tr("Russian"), tr("%1 and %2")
.arg("Yurkovsky Andrey &lt;anyr@tut.by&gt;")
.arg(QString::fromUtf8("Белый Владимир &lt;wiselord1983@gmail.com&gt;")))+
trad(tr("Hungarian"), "Charles Barcza &lt;kbarcza@blackpanther.hu&gt;") +
trad(tr("Polish"), tr("%1 and %2")
.arg("qla &lt;qla0@vp.pl&gt;")
.arg("Jarek &lt;ajep9691@wp.pl&gt;") ) +
trad(tr("Japanese"), "Nardog &lt;nardog@e2umail.com&gt;") +
trad(tr("Dutch"), "Wesley S. &lt;wesley@ubuntu-nl.org&gt;") +
trad(tr("Ukrainian"), "Motsyo Gennadi &lt;drool@altlinux.ru&gt;") +
trad(tr("Portuguese - Brazil"), "Ventura &lt;ventura.barbeiro@terra.com.br&gt;") +
trad(tr("Georgian"), "George Machitidze &lt;giomac@gmail.com&gt;") +
trad(tr("Czech"), QString::fromUtf8("Martin Dvořák &lt;martin.dvorak@centrum.cz&gt;")) +
trad(tr("Bulgarian"), "&lt;marzeliv@mail.bg&gt;") +
trad(tr("Turkish"), "alper er &lt;alperer@gmail.com&gt;") +
trad(tr("Swedish"), "Leif Larsson &lt;leif.larsson@gmail.com&gt;") +
trad(tr("Serbian"), "Kunalagon Umuhanik &lt;kunalagon@gmail.com&gt;") +
trad(tr("Traditional Chinese"), "Hoopoe &lt;dai715.tw@yahoo.com.tw&gt;") +
trad(tr("Romanian"), "DoruH &lt;doruhushhush@hotmail.com&gt;") +
trad(tr("Portuguese - Portugal"), "Waxman &lt;waxman.pt@gmail.com&gt;") +
trad(tr("Greek"), "my80s &lt;wamy80s@gmail.com&gt;") +
trad(tr("Finnish"), "peeaivo &lt;peeaivo@gmail.com&gt;") +
"</ul>" +
tr("Logo designed by %1").arg("Charles Barcza &lt;kbarcza@blackpanther.hu&gt;") +
"<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"

View file

@ -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

View file

@ -57,6 +57,7 @@
#include "inputurl.h" #include "inputurl.h"
#include "recents.h" #include "recents.h"
#include "about.h" #include "about.h"
#include "errordialog.h"
#include "clhelp.h" #include "clhelp.h"
#include "config.h" #include "config.h"
@ -165,7 +166,7 @@ void BaseGui::initializeGui() {
if (pref->stay_on_top) toggleStayOnTop(TRUE); if (pref->stay_on_top) toggleStayOnTop(TRUE);
toggleFrameCounter( pref->show_frame_counter ); toggleFrameCounter( pref->show_frame_counter );
#if QT_VERSION >= 0x040200 #if ALLOW_CHANGE_STYLESHEET
changeStyleSheet(pref->iconset); changeStyleSheet(pref->iconset);
#endif #endif
@ -684,6 +685,9 @@ void BaseGui::createActions() {
doubleSizeAct = new MyAction( Qt::CTRL | Qt::Key_D, this, "toggle_double_size"); doubleSizeAct = new MyAction( Qt::CTRL | Qt::Key_D, this, "toggle_double_size");
connect( doubleSizeAct, SIGNAL(triggered()), core, SLOT(toggleDoubleSize()) ); connect( doubleSizeAct, SIGNAL(triggered()), core, SLOT(toggleDoubleSize()) );
resetVideoEqualizerAct = new MyAction( this, "reset_video_equalizer");
connect( resetVideoEqualizerAct, SIGNAL(triggered()), equalizer, SLOT(reset()) );
// Group actions // Group actions
// OSD // OSD
@ -769,6 +773,16 @@ void BaseGui::createActions() {
connect( aspectGroup, SIGNAL(activated(int)), connect( aspectGroup, SIGNAL(activated(int)),
core, SLOT(changeAspectRatio(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 // Audio track
audioTrackGroup = new MyActionGroup(this); audioTrackGroup = new MyActionGroup(this);
connect( audioTrackGroup, SIGNAL(activated(int)), connect( audioTrackGroup, SIGNAL(activated(int)),
@ -891,6 +905,7 @@ void BaseGui::setActionsEnabled(bool b) {
sizeGroup->setActionsEnabled(b); sizeGroup->setActionsEnabled(b);
deinterlaceGroup->setActionsEnabled(b); deinterlaceGroup->setActionsEnabled(b);
aspectGroup->setActionsEnabled(b); aspectGroup->setActionsEnabled(b);
rotateGroup->setActionsEnabled(b);
channelsGroup->setActionsEnabled(b); channelsGroup->setActionsEnabled(b);
stereoGroup->setActionsEnabled(b); stereoGroup->setActionsEnabled(b);
} }
@ -936,7 +951,6 @@ void BaseGui::enableActionsOnPlaying() {
addLetterboxAct->setEnabled(false); addLetterboxAct->setEnabled(false);
#endif #endif
upscaleAct->setEnabled(false); upscaleAct->setEnabled(false);
doubleSizeAct->setEnabled(false); doubleSizeAct->setEnabled(false);
// Moving and zoom // Moving and zoom
@ -952,6 +966,7 @@ void BaseGui::enableActionsOnPlaying() {
sizeGroup->setActionsEnabled(false); sizeGroup->setActionsEnabled(false);
deinterlaceGroup->setActionsEnabled(false); deinterlaceGroup->setActionsEnabled(false);
aspectGroup->setActionsEnabled(false); aspectGroup->setActionsEnabled(false);
rotateGroup->setActionsEnabled(false);
} }
} }
@ -1129,6 +1144,7 @@ void BaseGui::retranslateStrings() {
nextChapterAct->change( tr("Next chapter") ); nextChapterAct->change( tr("Next chapter") );
prevChapterAct->change( tr("Previous chapter") ); prevChapterAct->change( tr("Previous chapter") );
doubleSizeAct->change( tr("&Toggle double size") ); doubleSizeAct->change( tr("&Toggle double size") );
resetVideoEqualizerAct->change( tr("Reset video equalizer") );
// Action groups // Action groups
osdNoneAct->change( tr("&Disabled") ); osdNoneAct->change( tr("&Disabled") );
@ -1183,6 +1199,9 @@ void BaseGui::retranslateStrings() {
videofilter_menu->menuAction()->setText( tr("F&ilters") ); videofilter_menu->menuAction()->setText( tr("F&ilters") );
videofilter_menu->menuAction()->setIcon( Images::icon("video_filters") ); 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()->setText( tr("De&noise") );
denoise_menu->menuAction()->setIcon( Images::icon("denoise") ); denoise_menu->menuAction()->setIcon( Images::icon("denoise") );
@ -1213,6 +1232,12 @@ void BaseGui::retranslateStrings() {
denoiseNormalAct->change( tr("Denoise nor&mal") ); denoiseNormalAct->change( tr("Denoise nor&mal") );
denoiseSoftAct->change( tr("Denoise &soft") ); 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 // Menu Audio
audiotrack_menu->menuAction()->setText( tr("&Track") ); audiotrack_menu->menuAction()->setText( tr("&Track") );
audiotrack_menu->menuAction()->setIcon( Images::icon("audio_track") ); audiotrack_menu->menuAction()->setIcon( Images::icon("audio_track") );
@ -1348,6 +1373,12 @@ void BaseGui::createCore() {
connect( core, SIGNAL(failedToParseMplayerVersion(QString)), connect( core, SIGNAL(failedToParseMplayerVersion(QString)),
this, SLOT(askForMplayerVersion(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 // Hide mplayer window
connect( core, SIGNAL(noVideo()), connect( core, SIGNAL(noVideo()),
this, SLOT(hidePanel()) ); this, SLOT(hidePanel()) );
@ -1355,7 +1386,9 @@ void BaseGui::createCore() {
void BaseGui::createMplayerWindow() { void BaseGui::createMplayerWindow() {
mplayerwindow = new MplayerWindow( panel ); mplayerwindow = new MplayerWindow( panel );
#if USE_COLORKEY
mplayerwindow->setColorKey( pref->color_key ); mplayerwindow->setColorKey( pref->color_key );
#endif
mplayerwindow->allowVideoMovement( pref->allow_video_movement ); mplayerwindow->allowVideoMovement( pref->allow_video_movement );
QHBoxLayout * layout = new QHBoxLayout; QHBoxLayout * layout = new QHBoxLayout;
@ -1562,6 +1595,12 @@ void BaseGui::createMenus() {
videoMenu->addMenu(denoise_menu); videoMenu->addMenu(denoise_menu);
*/ */
// Rotate submenu
rotate_menu = new QMenu(this);
rotate_menu->addActions(rotateGroup->actions());
videoMenu->addMenu(rotate_menu);
videoMenu->addAction(flipAct); videoMenu->addAction(flipAct);
videoMenu->addSeparator(); videoMenu->addSeparator();
videoMenu->addAction(equalizerAct); videoMenu->addAction(equalizerAct);
@ -1719,8 +1758,8 @@ void BaseGui::closeWindow() {
qDebug("BaseGui::closeWindow"); qDebug("BaseGui::closeWindow");
core->stop(); core->stop();
//qApp->closeAllWindows();
//qApp->quit(); //qApp->quit();
//emit quitSolicited();
hide(); hide();
} }
@ -1796,7 +1835,7 @@ void BaseGui::applyNewPreferences() {
if (_interface->iconsetChanged()) { if (_interface->iconsetChanged()) {
need_update_language = true; need_update_language = true;
// Stylesheet // Stylesheet
#if QT_VERSION >= 0x040200 #if ALLOW_CHANGE_STYLESHEET
changeStyleSheet(pref->iconset); changeStyleSheet(pref->iconset);
#endif #endif
} }
@ -1825,9 +1864,11 @@ void BaseGui::applyNewPreferences() {
if (advanced->clearingBackgroundChanged()) { if (advanced->clearingBackgroundChanged()) {
mplayerwindow->videoLayer()->allowClearingBackground(pref->always_clear_video_background); mplayerwindow->videoLayer()->allowClearingBackground(pref->always_clear_video_background);
} }
#if USE_COLORKEY
if (advanced->colorkeyChanged()) { if (advanced->colorkeyChanged()) {
mplayerwindow->setColorKey( pref->color_key ); mplayerwindow->setColorKey( pref->color_key );
} }
#endif
if (advanced->monitorAspectChanged()) { if (advanced->monitorAspectChanged()) {
mplayerwindow->setMonitorAspect( pref->monitor_aspect_double() ); mplayerwindow->setMonitorAspect( pref->monitor_aspect_double() );
} }
@ -2162,6 +2203,9 @@ void BaseGui::updateWidgets() {
// Aspect ratio // Aspect ratio
aspectGroup->setChecked( core->mset.aspect_ratio_id ); aspectGroup->setChecked( core->mset.aspect_ratio_id );
// Rotate
rotateGroup->setChecked( core->mset.rotate );
// OSD // OSD
osdGroup->setChecked( pref->osd ); osdGroup->setChecked( pref->osd );
@ -2284,6 +2328,9 @@ void BaseGui::updateWidgets() {
// Enable or disable subtitle options // Enable or disable subtitle options
bool e = ((core->mset.current_sub_id != MediaSettings::SubNone) && bool e = ((core->mset.current_sub_id != MediaSettings::SubNone) &&
(core->mset.current_sub_id != MediaSettings::NoneSelected)); (core->mset.current_sub_id != MediaSettings::NoneSelected));
if (pref->use_closed_caption_subs) e = true; // Enable if using closed captions
decSubDelayAct->setEnabled(e); decSubDelayAct->setEnabled(e);
incSubDelayAct->setEnabled(e); incSubDelayAct->setEnabled(e);
decSubPosAct->setEnabled(e); decSubPosAct->setEnabled(e);
@ -3315,6 +3362,7 @@ void BaseGui::checkMousePos(QPoint p) {
} }
} }
#if ALLOW_CHANGE_STYLESHEET
void BaseGui::loadQss(QString filename) { void BaseGui::loadQss(QString filename) {
QFile file( filename ); QFile file( filename );
file.open(QFile::ReadOnly); file.open(QFile::ReadOnly);
@ -3341,6 +3389,7 @@ void BaseGui::changeStyleSheet(QString style) {
} }
} }
} }
#endif
void BaseGui::loadActions() { void BaseGui::loadActions() {
qDebug("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 // Language change stuff
void BaseGui::changeEvent(QEvent *e) { void BaseGui::changeEvent(QEvent *e) {

View file

@ -186,9 +186,14 @@ protected slots:
//! version supplied by the user //! version supplied by the user
void askForMplayerVersion(QString); void askForMplayerVersion(QString);
void showExitCodeFromMplayer(int exit_code);
void showErrorFromMplayer(QProcess::ProcessError);
// stylesheet // stylesheet
#if ALLOW_CHANGE_STYLESHEET
virtual void loadQss(QString filename); virtual void loadQss(QString filename);
virtual void changeStyleSheet(QString style); virtual void changeStyleSheet(QString style);
#endif
#if NEW_RESIZE_CODE #if NEW_RESIZE_CODE
void calculateDiff(); //!< Updates diff_size void calculateDiff(); //!< Updates diff_size
@ -215,6 +220,9 @@ signals:
void middleClicked(); void middleClicked();
*/ */
//! Sent when the user wants to close the main window
void quitSolicited();
protected: protected:
virtual void retranslateStrings(); virtual void retranslateStrings();
virtual void changeEvent(QEvent * event); virtual void changeEvent(QEvent * event);
@ -369,6 +377,7 @@ protected:
MyAction * nextChapterAct; MyAction * nextChapterAct;
MyAction * prevChapterAct; MyAction * prevChapterAct;
MyAction * doubleSizeAct; MyAction * doubleSizeAct;
MyAction * resetVideoEqualizerAct;
// Moving and zoom // Moving and zoom
MyAction * moveUpAct; MyAction * moveUpAct;
@ -429,6 +438,14 @@ protected:
MyAction * aspect43To169Act; MyAction * aspect43To169Act;
#endif #endif
// Rotate Group
MyActionGroup * rotateGroup;
MyAction * rotateNoneAct;
MyAction * rotateClockwiseFlipAct;
MyAction * rotateClockwiseAct;
MyAction * rotateCounterclockwiseAct;
MyAction * rotateCounterclockwiseFlipAct;
// Audio Channels Action Group // Audio Channels Action Group
MyActionGroup * channelsGroup; MyActionGroup * channelsGroup;
/* MyAction * channelsDefaultAct; */ /* MyAction * channelsDefaultAct; */
@ -442,13 +459,14 @@ protected:
MyAction * leftChannelAct; MyAction * leftChannelAct;
MyAction * rightChannelAct; MyAction * rightChannelAct;
// Audio Track Group // Other groups
MyActionGroup * audioTrackGroup; MyActionGroup * audioTrackGroup;
MyActionGroup * subtitleTrackGroup; MyActionGroup * subtitleTrackGroup;
MyActionGroup * titleGroup; MyActionGroup * titleGroup;
MyActionGroup * angleGroup; MyActionGroup * angleGroup;
MyActionGroup * chapterGroup; MyActionGroup * chapterGroup;
// MENUS // MENUS
QMenu *openMenu; QMenu *openMenu;
QMenu *playMenu; QMenu *playMenu;
@ -477,6 +495,7 @@ protected:
QMenu * audiofilter_menu; QMenu * audiofilter_menu;
QMenu * logs_menu; QMenu * logs_menu;
QMenu * panscan_menu; QMenu * panscan_menu;
QMenu * rotate_menu;
QMenu * popup; QMenu * popup;
QMenu * recentfiles_menu; QMenu * recentfiles_menu;

View file

@ -242,8 +242,11 @@ void BaseGuiPlus::trayIconActivated(QSystemTrayIcon::ActivationReason reason) {
} }
void BaseGuiPlus::toggleShowAll() { void BaseGuiPlus::toggleShowAll() {
// Ignore if tray is not visible
if (tray->isVisible()) {
showAll( !isVisible() ); showAll( !isVisible() );
} }
}
void BaseGuiPlus::showAll(bool b) { void BaseGuiPlus::showAll(bool b) {
if (!b) { if (!b) {

View file

@ -53,6 +53,12 @@
#define STYLE_SWITCHING 1 #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 // New code to resize the main window
#define NEW_RESIZE_CODE 1 #define NEW_RESIZE_CODE 1
@ -98,6 +104,11 @@
#define SCALE_ASS_SUBS 1 #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) // Testing with a QGLWidget (for Windows)
#define USE_GL_WIDGET 0 #define USE_GL_WIDGET 0

View file

@ -66,6 +66,13 @@ Core::Core( MplayerWindow *mpw, QWidget* parent )
proc = new MplayerProcess(this); 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)), connect( proc, SIGNAL(receivedCurrentSec(double)),
this, SLOT(changeCurrentSec(double)) ); this, SLOT(changeCurrentSec(double)) );
@ -129,14 +136,15 @@ Core::Core( MplayerWindow *mpw, QWidget* parent )
connect( this, SIGNAL(stateChanged(Core::State)), connect( this, SIGNAL(stateChanged(Core::State)),
this, SLOT(watchState(Core::State)) ); this, SLOT(watchState(Core::State)) );
connect( proc, SIGNAL(error(QProcess::ProcessError)),
this, SIGNAL(mplayerFailed(QProcess::ProcessError)) );
//pref->load(); //pref->load();
mset.reset(); mset.reset();
// Mplayerwindow // Mplayerwindow
connect( this, SIGNAL(aboutToStartPlaying()), connect( this, SIGNAL(aboutToStartPlaying()),
mplayerwindow->videoLayer(), SLOT(playingStarted()) ); mplayerwindow->videoLayer(), SLOT(playingStarted()) );
connect( proc, SIGNAL(processExited()),
mplayerwindow->videoLayer(), SLOT(playingStopped()) );
mplayerwindow->videoLayer()->allowClearingBackground(pref->always_clear_video_background); mplayerwindow->videoLayer()->allowClearingBackground(pref->always_clear_video_background);
mplayerwindow->setMonitorAspect( pref->monitor_aspect_double() ); mplayerwindow->setMonitorAspect( pref->monitor_aspect_double() );
@ -929,10 +937,10 @@ void Core::processFinished()
//emit stateChanged(state()); //emit stateChanged(state());
} }
int exit_status = proc->exitStatus(); int exit_code = proc->exitCode();
qDebug(" exit_status: %d", exit_status); qDebug("Core::processFinished: exit_code: %d", exit_code);
if (exit_status != 0) { if (exit_code != 0) {
emit mplayerFinishedWithError(exit_status); emit mplayerFinishedWithError(exit_code);
} }
} }
@ -1029,8 +1037,12 @@ void Core::startMplayer( QString file, double seek ) {
proc->addArgument("-noquiet"); proc->addArgument("-noquiet");
if (pref->fullscreen && pref->use_mplayer_window) {
proc->addArgument("-fs");
} else {
// No mplayer fullscreen mode // No mplayer fullscreen mode
proc->addArgument("-nofs"); proc->addArgument("-nofs");
}
// Demuxer and audio and video codecs: // Demuxer and audio and video codecs:
if (!mset.forced_demuxer.isEmpty()) { if (!mset.forced_demuxer.isEmpty()) {
@ -1178,13 +1190,20 @@ void Core::startMplayer( QString file, double seek ) {
proc->addArgument("-wid"); proc->addArgument("-wid");
proc->addArgument( QString::number( (int) mplayerwindow->videoLayer()->winId() ) ); proc->addArgument( QString::number( (int) mplayerwindow->videoLayer()->winId() ) );
#if USE_COLORKEY
if (pref->vo == "directx") {
proc->addArgument("-colorkey"); proc->addArgument("-colorkey");
//proc->addArgument( "0x"+QString::number(pref->color_key, 16) ); //proc->addArgument( "0x"+QString::number(pref->color_key, 16) );
proc->addArgument( Helper::colorToRGB(pref->color_key) ); 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
// Set monitoraspect to desktop aspect // Square pixels
proc->addArgument("-monitoraspect"); proc->addArgument("-monitorpixelaspect");
proc->addArgument( QString::number( DesktopInfo::desktop_aspectRatio(mplayerwindow) ) ); proc->addArgument("1");
} else { } else {
// no -wid // no -wid
if (!pref->monitor_aspect.isEmpty()) { if (!pref->monitor_aspect.isEmpty()) {
@ -1442,6 +1461,12 @@ void Core::startMplayer( QString file, double seek ) {
} }
#endif #endif
// Rotate
if (mset.rotate != MediaSettings::NoRotate) {
proc->addArgument( "-vf-add" );
proc->addArgument( QString("rotate=%1").arg(mset.rotate) );
}
// Denoise // Denoise
if (mset.current_denoiser != MediaSettings::NoDenoise) { if (mset.current_denoiser != MediaSettings::NoDenoise) {
proc->addArgument("-vf-add"); proc->addArgument("-vf-add");
@ -1542,9 +1567,15 @@ void Core::startMplayer( QString file, double seek ) {
proc->addArgument("screenshot"); 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("-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 // Audio channels
@ -2708,6 +2739,13 @@ void Core::nextOSD() {
changeOSD( osd ); changeOSD( osd );
} }
void Core::changeRotate(int r) {
if (mset.rotate != r) {
mset.rotate = r;
restartPlay();
}
}
void Core::changeSize(int n) { void Core::changeSize(int n) {
if ( /*(n != pref->size_factor) &&*/ (!pref->use_mplayer_window) ) { if ( /*(n != pref->size_factor) &&*/ (!pref->use_mplayer_window) ) {
pref->size_factor = n; pref->size_factor = n;

View file

@ -20,7 +20,7 @@
#define _CORE_H_ #define _CORE_H_
#include <QObject> #include <QObject>
#include <QProcess> // For QProcess::ProcessError
#include "mediadata.h" #include "mediadata.h"
#include "mediasettings.h" #include "mediasettings.h"
#include "config.h" #include "config.h"
@ -207,6 +207,8 @@ public slots:
void toggleDoubleSize(); void toggleDoubleSize();
void changePanscan(double); // Zoom on mplayerwindow void changePanscan(double); // Zoom on mplayerwindow
void changeRotate(int r);
void incPanscan(); void incPanscan();
void decPanscan(); void decPanscan();
void resetPanscan(); void resetPanscan();
@ -289,10 +291,15 @@ signals:
void showTime(double sec); void showTime(double sec);
void showFrame(int frame); void showFrame(int frame);
void needResize(int w, int h); void needResize(int w, int h);
void mplayerFinishedWithError(int);
void noVideo(); void noVideo();
void volumeChanged(int); 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: // Resend signal from mplayerprocess:
void failedToParseMplayerVersion(QString line_with_mplayer_version); void failedToParseMplayerVersion(QString line_with_mplayer_version);

View file

@ -85,14 +85,15 @@ DefaultGui::~DefaultGui() {
saveConfig(); saveConfig();
} }
/*
void DefaultGui::closeEvent( QCloseEvent * ) { void DefaultGui::closeEvent( QCloseEvent * ) {
qDebug("DefaultGui::closeEvent"); /*qDebug("DefaultGui::closeEvent");
//BaseGuiPlus::closeEvent(e); //BaseGuiPlus::closeEvent(e);
qDebug("w: %d h: %d", width(), height() ); qDebug("w: %d h: %d", width(), height() );*/
hide();
} }
*/
void DefaultGui::createActions() { void DefaultGui::createActions() {
qDebug("DefaultGui::createActions"); qDebug("DefaultGui::createActions");
@ -570,10 +571,4 @@ void DefaultGui::loadConfig() {
updateWidgets(); updateWidgets();
} }
void DefaultGui::closeEvent (QCloseEvent * event)
{
hide();
event->ignore();
}
#include "moc_defaultgui.cpp" #include "moc_defaultgui.cpp"

View file

@ -47,7 +47,6 @@ public slots:
//virtual void showPlaylist(bool b); //virtual void showPlaylist(bool b);
protected: protected:
void closeEvent (QCloseEvent * event);
virtual void retranslateStrings(); virtual void retranslateStrings();
virtual QMenu * createPopupMenu(); virtual QMenu * createPopupMenu();
@ -68,7 +67,7 @@ protected:
virtual void aboutToExitCompactMode(); virtual void aboutToExitCompactMode();
virtual void resizeEvent( QResizeEvent * ); virtual void resizeEvent( QResizeEvent * );
/* virtual void closeEvent( QCloseEvent * ); */ virtual void closeEvent( QCloseEvent * );
protected slots: protected slots:
virtual void updateWidgets(); virtual void updateWidgets();

View file

@ -52,7 +52,7 @@ Extensions::Extensions()
<< "mkv" << "nsv" << "ram" << "flv" << "mkv" << "nsv" << "ram" << "flv"
<< "ts" << "rmvb" << "dvr-ms"; << "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" _subtitles << "srt" << "sub" << "ssa" << "ass" << "idx" << "txt" << "smi"
<< "rt" << "utf" << "aqt"; << "rt" << "utf" << "aqt";

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -96,5 +96,7 @@
<file>icons-png/cl_help.png</file> <file>icons-png/cl_help.png</file>
<file>icons-png/osd.png</file> <file>icons-png/osd.png</file>
<file>icons-png/angle.png</file> <file>icons-png/angle.png</file>
<file>icons-png/rotate.png</file>
<file>icons-png/warning.png</file>
</qresource> </qresource>
</RCC> </RCC>

View file

@ -16,43 +16,28 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 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 <QApplication>
#include <QLocale> #include <QFile>
#include <QTranslator>
#include <QFileInfo> #include "smplayer.h"
#include <QDir> #include "global.h"
#include <QSettings> #include "helper.h"
#include <QRegExp>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#define USE_LOCKS 1
using namespace Global; using namespace Global;
void myMessageOutput( QtMsgType type, const char *msg ) {
static QRegExp rx_log; static QRegExp rx_log;
void myMessageOutput( QtMsgType type, const char *msg ) { if (pref) {
if ( (!pref) || (!pref->log_smplayer) ) return; if (!pref->log_smplayer) return;
rx_log.setPattern(pref->log_filter); rx_log.setPattern(pref->log_filter);
} else {
rx_log.setPattern(".*");
}
QString line = QString::fromUtf8(msg); QString line = QString::fromUtf8(msg);
switch ( type ) { switch ( type ) {
@ -85,279 +70,93 @@ void myMessageOutput( QtMsgType type, const char *msg ) {
} }
} }
void showInfo() { #if USE_LOCKS
QString s = QObject::tr("This is SMPlayer v. %1 running on %2") void remove_lock(QString lock_file) {
.arg(smplayerVersion()) if (QFile::exists(lock_file)) {
#ifdef Q_OS_LINUX qDebug("main: removing %s", lock_file.toUtf8().data());
.arg("Linux") QFile::remove(lock_file);
#else }
#ifdef Q_OS_WIN }
.arg("Windows")
#else
.arg("Other OS")
#endif #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());
}
}
}
int main( int argc, char ** argv ) int main( int argc, char ** argv )
{ {
QApplication a( argc, argv ); QApplication a( argc, argv );
//a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
#ifdef Q_OS_WIN // Sets the ini_path
if (a.arguments().contains("-uninstall")){ QString ini_path;
//Called by uninstaller. Will restore old associations. if (QFile::exists( a.applicationDirPath() + "/smplayer.ini" ) ) {
WinFileAssoc RegAssoc; ini_path = a.applicationDirPath();
Extensions exts; qDebug("main: using existing %s", QString(ini_path + "/smplayer.ini").toUtf8().data());
QStringList regExts;
RegAssoc.GetRegisteredExtensions(exts.multimedia(), regExts);
RegAssoc.RestoreFileAssociations(regExts);
printf("Restored associations\n");
return 0;
} }
#endif QStringList args = a.arguments();
int pos = args.indexOf("-ini-path");
if ( pos != -1) {
if (pos+1 < args.count()) {
QString app_path = a.applicationDirPath(); pos++;
Helper::setAppPath(app_path); ini_path = args[pos];
//qDebug( "main: application path: '%s'", app_path.toUtf8().data()); // Delete from list
args.removeAt(pos);
QString ini_path=""; args.removeAt(pos-1);
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());
}
int close_at_end = -1; // -1 = not set, 1 = true, 0 false
int start_in_fullscreen = -1;
bool show_help = false;
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 { } else {
printf("Error: expected parameter for -ini-path\r\n"); printf("Error: expected parameter for -ini-path\r\n");
return -1; return SMPlayer::ErrorArgument;
} }
} }
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 ); qInstallMsgHandler( myMessageOutput );
// Application translations #if USE_LOCKS
translator->load( pref->language ); //setIniPath will be set later in global_init, but we need it here
Helper::setIniPath(ini_path);
showInfo(); QString lock_file = Helper::iniPath() + "/smplayer_init.lock";
qDebug("main: lock_file: %s", lock_file.toUtf8().data());
if (show_help) { if (QFile::exists(lock_file)) {
printf("%s\n", CLHelp::help().toLocal8Bit().data()); qDebug("main: %s exists, waiting...", lock_file.toUtf8().data());
return 0; // 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);
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 { } else {
printf("Error: action couldn't be passed to the running instance"); // Create lock file
return -1; QFile f(lock_file);
} if (f.open(QIODevice::WriteOnly)) {
} f.write("smplayer lock file");
else f.close();
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 { } else {
qDebug("main: files couldn't be sent to another instance"); qWarning("main: can't open %s for writing", lock_file.toUtf8().data());
}
} }
return 0; }
#endif
} else { SMPlayer * smplayer = new SMPlayer(ini_path);
if (!action.isEmpty()) { SMPlayer::ExitCode c = smplayer->processArgs( args );
printf("Error: no running instance found\r\n"); if (c != SMPlayer::NoExit) {
return -1; #if USE_LOCKS
} remove_lock(lock_file);
} #endif
return c;
} }
if (!pref->default_font.isEmpty()) { a.connect(smplayer->gui(), SIGNAL(quitSolicited()), &a, SLOT(quit()));
QFont f; smplayer->start();
f.fromString(pref->default_font);
a.setFont(f);
}
if (close_at_end != -1) { #if USE_LOCKS
pref->close_on_finish = close_at_end; remove_lock(lock_file);
} #endif
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() ) );
int r = a.exec(); int r = a.exec();
delete w;
global_end(); delete smplayer;
return r; return r;
} }

View file

@ -91,6 +91,7 @@ void MediaSettings::reset() {
starting_time = -1; // Not set yet. starting_time = -1; // Not set yet.
rotate = NoRotate;
flip = false; flip = false;
is264andHD = false; is264andHD = false;
@ -172,6 +173,7 @@ void MediaSettings::list() {
qDebug(" panscan_factor: %f", panscan_factor); qDebug(" panscan_factor: %f", panscan_factor);
qDebug(" rotate: %d", rotate);
qDebug(" flip: %d", flip); qDebug(" flip: %d", flip);
qDebug(" forced_demuxer: '%s'", forced_demuxer.toUtf8().data()); 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( "panscan_factor", panscan_factor);
set->setValue( "rotate", rotate );
set->setValue( "flip", flip); set->setValue( "flip", flip);
set->setValue( "forced_demuxer", forced_demuxer); set->setValue( "forced_demuxer", forced_demuxer);
@ -340,6 +343,7 @@ void MediaSettings::load(QSettings * set) {
panscan_factor = set->value( "panscan_factor", panscan_factor).toDouble(); panscan_factor = set->value( "panscan_factor", panscan_factor).toDouble();
rotate = set->value( "rotate", rotate).toInt();
flip = set->value( "flip", flip).toBool(); flip = set->value( "flip", flip).toBool();
forced_demuxer = set->value( "forced_demuxer", forced_demuxer).toString(); forced_demuxer = set->value( "forced_demuxer", forced_demuxer).toString();

View file

@ -48,6 +48,10 @@ public:
enum AudioChannels { ChDefault = 0, ChStereo = 2, ChSurround = 4, enum AudioChannels { ChDefault = 0, ChStereo = 2, ChSurround = 4,
ChFull51 = 6 }; ChFull51 = 6 };
enum StereoMode { Stereo = 0, Left = 1, Right = 2 }; 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 }; enum IDs { NoneSelected = -1000, SubNone = 90000 };
MediaSettings(); MediaSettings();
@ -116,6 +120,7 @@ public:
double panscan_factor; // mplayerwindow zoom double panscan_factor; // mplayerwindow zoom
int rotate;
bool flip; //!< Flip image bool flip; //!< Flip image
// This a property of the video and it should be // This a property of the video and it should be

View file

@ -34,7 +34,7 @@ MplayerProcess::MplayerProcess(QObject * parent) : MyProcess(parent)
this, SLOT(parseLine(QByteArray)) ); this, SLOT(parseLine(QByteArray)) );
connect( this, SIGNAL(finished(int,QProcess::ExitStatus)), connect( this, SIGNAL(finished(int,QProcess::ExitStatus)),
this, SLOT(processFinished()) ); this, SLOT(processFinished(int,QProcess::ExitStatus)) );
connect( this, SIGNAL(error(QProcess::ProcessError)), connect( this, SIGNAL(error(QProcess::ProcessError)),
this, SLOT(gotError(QProcess::ProcessError)) ); this, SLOT(gotError(QProcess::ProcessError)) );
@ -385,9 +385,14 @@ void MplayerProcess::parseLine(QByteArray ba) {
else else
// Clip info // 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 // Name
if (rx_clip_name.indexIn(line) > -1) { 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()); qDebug("MplayerProcess::parseLine: clip_name: '%s'", s.toUtf8().data());
md.clip_name = s; md.clip_name = s;
} }
@ -395,7 +400,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
// Artist // Artist
if (rx_clip_artist.indexIn(line) > -1) { 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()); qDebug("MplayerProcess::parseLine: clip_artist: '%s'", s.toUtf8().data());
md.clip_artist = s; md.clip_artist = s;
} }
@ -403,7 +408,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
// Author // Author
if (rx_clip_author.indexIn(line) > -1) { 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()); qDebug("MplayerProcess::parseLine: clip_author: '%s'", s.toUtf8().data());
md.clip_author = s; md.clip_author = s;
} }
@ -411,7 +416,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
// Album // Album
if (rx_clip_album.indexIn(line) > -1) { 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()); qDebug("MplayerProcess::parseLine: clip_album: '%s'", s.toUtf8().data());
md.clip_album = s; md.clip_album = s;
} }
@ -419,7 +424,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
// Genre // Genre
if (rx_clip_genre.indexIn(line) > -1) { 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()); qDebug("MplayerProcess::parseLine: clip_genre: '%s'", s.toUtf8().data());
md.clip_genre = s; md.clip_genre = s;
} }
@ -427,7 +432,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
// Date // Date
if (rx_clip_date.indexIn(line) > -1) { 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()); qDebug("MplayerProcess::parseLine: clip_date: '%s'", s.toUtf8().data());
md.clip_date = s; md.clip_date = s;
} }
@ -435,7 +440,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
// Track // Track
if (rx_clip_track.indexIn(line) > -1) { 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()); qDebug("MplayerProcess::parseLine: clip_track: '%s'", s.toUtf8().data());
md.clip_track = s; md.clip_track = s;
} }
@ -443,7 +448,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
// Copyright // Copyright
if (rx_clip_copyright.indexIn(line) > -1) { 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()); qDebug("MplayerProcess::parseLine: clip_copyright: '%s'", s.toUtf8().data());
md.clip_copyright = s; md.clip_copyright = s;
} }
@ -451,7 +456,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
// Comment // Comment
if (rx_clip_comment.indexIn(line) > -1) { 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()); qDebug("MplayerProcess::parseLine: clip_comment: '%s'", s.toUtf8().data());
md.clip_comment = s; md.clip_comment = s;
} }
@ -459,7 +464,7 @@ void MplayerProcess::parseLine(QByteArray ba) {
// Software // Software
if (rx_clip_software.indexIn(line) > -1) { 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()); qDebug("MplayerProcess::parseLine: clip_software: '%s'", s.toUtf8().data());
md.clip_software = s; md.clip_software = s;
} }
@ -559,8 +564,8 @@ void MplayerProcess::parseLine(QByteArray ba) {
} }
// Called when the process is finished // Called when the process is finished
void MplayerProcess::processFinished() { void MplayerProcess::processFinished(int exitCode, QProcess::ExitStatus exitStatus) {
qDebug("MplayerProcess::processFinished"); qDebug("MplayerProcess::processFinished: exitCode: %d, status: %d", exitCode, (int) exitStatus);
// Send this signal before the endoffile one, otherwise // Send this signal before the endoffile one, otherwise
// the playlist will start to play next file before all // the playlist will start to play next file before all
// objects are notified that the process has exited. // objects are notified that the process has exited.

View file

@ -65,7 +65,7 @@ signals:
protected slots: protected slots:
void parseLine(QByteArray ba); void parseLine(QByteArray ba);
void processFinished(); void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
void gotError(QProcess::ProcessError); void gotError(QProcess::ProcessError);
protected: protected:

View file

@ -169,9 +169,11 @@ MplayerWindow::MplayerWindow(QWidget* parent, Qt::WindowFlags f)
MplayerWindow::~MplayerWindow() { MplayerWindow::~MplayerWindow() {
} }
#if USE_COLORKEY
void MplayerWindow::setColorKey( QColor c ) { void MplayerWindow::setColorKey( QColor c ) {
Helper::setBackgroundColor( mplayerlayer, c ); Helper::setBackgroundColor( mplayerlayer, c );
} }
#endif
void MplayerWindow::retranslateStrings() { void MplayerWindow::retranslateStrings() {
//qDebug("MplayerWindow::retranslateStrings"); //qDebug("MplayerWindow::retranslateStrings");

View file

@ -122,7 +122,9 @@ public:
void setMonitorAspect(double asp); void setMonitorAspect(double asp);
void updateVideoWindow(); void updateVideoWindow();
#if USE_COLORKEY
void setColorKey(QColor c); void setColorKey(QColor c);
#endif
void setOffsetX( int ); void setOffsetX( int );
int offsetX(); int offsetX();

View file

@ -20,7 +20,7 @@
#include "prefadvanced.h" #include "prefadvanced.h"
#include "images.h" #include "images.h"
#include "preferences.h" #include "preferences.h"
#include "config.h"
#include <QColorDialog> #include <QColorDialog>
PrefAdvanced::PrefAdvanced(QWidget * parent, Qt::WindowFlags f) PrefAdvanced::PrefAdvanced(QWidget * parent, Qt::WindowFlags f)
@ -32,6 +32,12 @@ PrefAdvanced::PrefAdvanced(QWidget * parent, Qt::WindowFlags f)
shortnames_check->hide(); shortnames_check->hide();
#endif #endif
#if !USE_COLORKEY
colorkey_label->hide();
colorkey_view->hide();
changeButton->hide();
#endif
// Monitor aspect // Monitor aspect
monitoraspect_combo->addItem("Auto"); monitoraspect_combo->addItem("Auto");
monitoraspect_combo->addItem("4:3"); monitoraspect_combo->addItem("4:3");
@ -90,7 +96,9 @@ void PrefAdvanced::setData(Preferences * pref) {
setMplayerAdditionalArguments( pref->mplayer_additional_options ); setMplayerAdditionalArguments( pref->mplayer_additional_options );
setMplayerAdditionalVideoFilters( pref->mplayer_additional_video_filters ); setMplayerAdditionalVideoFilters( pref->mplayer_additional_video_filters );
setMplayerAdditionalAudioFilters( pref->mplayer_additional_audio_filters ); setMplayerAdditionalAudioFilters( pref->mplayer_additional_audio_filters );
#if USE_COLORKEY
setColorKey( pref->color_key ); setColorKey( pref->color_key );
#endif
setLogMplayer( pref->log_mplayer ); setLogMplayer( pref->log_mplayer );
setLogSmplayer( pref->log_smplayer ); setLogSmplayer( pref->log_smplayer );
@ -108,8 +116,10 @@ void PrefAdvanced::setData(Preferences * pref) {
void PrefAdvanced::getData(Preferences * pref) { void PrefAdvanced::getData(Preferences * pref) {
requires_restart = false; requires_restart = false;
clearing_background_changed = false; clearing_background_changed = false;
colorkey_changed = false;
monitor_aspect_changed = false; monitor_aspect_changed = false;
#if USE_COLORKEY
colorkey_changed = false;
#endif
if (pref->monitor_aspect != monitorAspect()) { if (pref->monitor_aspect != monitorAspect()) {
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_options, mplayerAdditionalArguments());
TEST_AND_SET(pref->mplayer_additional_video_filters, mplayerAdditionalVideoFilters()); TEST_AND_SET(pref->mplayer_additional_video_filters, mplayerAdditionalVideoFilters());
TEST_AND_SET(pref->mplayer_additional_audio_filters, mplayerAdditionalAudioFilters()); TEST_AND_SET(pref->mplayer_additional_audio_filters, mplayerAdditionalAudioFilters());
#if USE_COLORKEY
if (pref->color_key != colorKey()) { if (pref->color_key != colorKey()) {
pref->color_key = colorKey(); pref->color_key = colorKey();
colorkey_changed = true; colorkey_changed = true;
requires_restart = true; requires_restart = true;
} }
#endif
pref->log_mplayer = logMplayer(); pref->log_mplayer = logMplayer();
pref->log_smplayer = logSmplayer(); pref->log_smplayer = logSmplayer();
pref->log_filter = logFilter(); pref->log_filter = logFilter();
@ -207,6 +218,7 @@ QString PrefAdvanced::mplayerAdditionalAudioFilters() {
return mplayer_afilters_edit->text(); return mplayer_afilters_edit->text();
} }
#if USE_COLORKEY
void PrefAdvanced::setColorKey(unsigned int c) { void PrefAdvanced::setColorKey(unsigned int c) {
QString color = QString::number(c, 16); QString color = QString::number(c, 16);
while (color.length() < 6) color = "0"+color; while (color.length() < 6) color = "0"+color;
@ -227,6 +239,7 @@ unsigned int PrefAdvanced::colorKey() {
return color; return color;
} }
#endif
void PrefAdvanced::on_changeButton_clicked() { void PrefAdvanced::on_changeButton_clicked() {
//bool ok; //bool ok;
@ -302,6 +315,11 @@ QString PrefAdvanced::noVideoText() {
void PrefAdvanced::createHelp() { void PrefAdvanced::createHelp() {
clearHelp(); 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"), setWhatsThis(log_smplayer_check, tr("Log SMPlayer output"),
tr("If this option is checked, smplayer will store the debugging " tr("If this option is checked, smplayer will store the debugging "
"messages that smplayer outputs " "messages that smplayer outputs "
@ -331,6 +349,14 @@ void PrefAdvanced::createHelp() {
"For instance: <i>^Core::.*</i> will display only the lines " "For instance: <i>^Core::.*</i> will display only the lines "
"starting with <i>Core::</i>") ); "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, setWhatsThis(not_clear_background_check,
tr("Don't repaint the background of the video window"), tr("Don't repaint the background of the video window"),
tr("Checking this option may reduce flickering, but it also might " 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, " "SMPlayer to pass to MPlayer the short version of the filenames, "
"and thus it will able to open them.") ); "and thus it will able to open them.") );
#endif #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" #include "moc_prefadvanced.cpp"

View file

@ -21,6 +21,7 @@
#include "ui_prefadvanced.h" #include "ui_prefadvanced.h"
#include "prefwidget.h" #include "prefwidget.h"
#include "config.h"
class Preferences; class Preferences;
@ -42,8 +43,10 @@ public:
void getData(Preferences * pref); void getData(Preferences * pref);
bool clearingBackgroundChanged() { return clearing_background_changed; }; bool clearingBackgroundChanged() { return clearing_background_changed; };
bool colorkeyChanged() { return colorkey_changed; };
bool monitorAspectChanged() { return monitor_aspect_changed; }; bool monitorAspectChanged() { return monitor_aspect_changed; };
#if USE_COLORKEY
bool colorkeyChanged() { return colorkey_changed; };
#endif
protected: protected:
virtual void createHelp(); virtual void createHelp();
@ -71,8 +74,10 @@ protected:
void setMplayerAdditionalAudioFilters(QString s); void setMplayerAdditionalAudioFilters(QString s);
QString mplayerAdditionalAudioFilters(); QString mplayerAdditionalAudioFilters();
#if USE_COLORKEY
void setColorKey(unsigned int c); void setColorKey(unsigned int c);
unsigned int colorKey(); unsigned int colorKey();
#endif
// Log options // Log options
void setLogMplayer(bool b); void setLogMplayer(bool b);
@ -105,8 +110,10 @@ protected slots:
private: private:
bool clearing_background_changed; bool clearing_background_changed;
bool colorkey_changed;
bool monitor_aspect_changed; bool monitor_aspect_changed;
#if USE_COLORKEY
bool colorkey_changed;
#endif
}; };
#endif #endif

View file

@ -212,7 +212,7 @@
<number>6</number> <number>6</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="textLabel1_23" > <widget class="QLabel" name="colorkey_label" >
<property name="text" > <property name="text" >
<string>&amp;Colorkey:</string> <string>&amp;Colorkey:</string>
</property> </property>

View file

@ -74,8 +74,9 @@ void Preferences::reset() {
vo = ""; vo = "";
ao = ""; ao = "";
#if USE_COLORKEY
color_key = 0x020202; color_key = 0x020202;
#endif
dvd_device = ""; dvd_device = "";
cdrom_device = ""; cdrom_device = "";
@ -290,7 +291,9 @@ void Preferences::save() {
set->setValue("vo", vo); set->setValue("vo", vo);
set->setValue("ao", ao); set->setValue("ao", ao);
#if USE_COLORKEY
set->setValue("color_key", QString::number(color_key,16)); set->setValue("color_key", QString::number(color_key,16));
#endif
set->setValue("fast_audio_change", fast_audio_change); set->setValue("fast_audio_change", fast_audio_change);
set->setValue("fast_chapter_change", fast_chapter_change); set->setValue("fast_chapter_change", fast_chapter_change);
@ -500,12 +503,14 @@ void Preferences::load() {
vo = set->value("vo", vo).toString(); vo = set->value("vo", vo).toString();
ao = set->value("ao", ao).toString(); ao = set->value("ao", ao).toString();
#if USE_COLORKEY
bool ok; bool ok;
QString color = set->value("color_key", QString::number(color_key,16)).toString(); QString color = set->value("color_key", QString::number(color_key,16)).toString();
unsigned int temp_color_key = color.toUInt(&ok, 16); unsigned int temp_color_key = color.toUInt(&ok, 16);
if (ok) if (ok)
color_key = temp_color_key; color_key = temp_color_key;
//color_key = set->value("color_key", color_key).toInt(); //color_key = set->value("color_key", color_key).toInt();
#endif
fast_audio_change = (OptionState) set->value("fast_audio_change", fast_audio_change).toInt(); 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(); fast_chapter_change = set->value("fast_chapter_change", fast_chapter_change).toBool();

View file

@ -49,7 +49,9 @@ public:
QString vo; // video output QString vo; // video output
QString ao; // audio output QString ao; // audio output
#if USE_COLORKEY
unsigned int color_key; unsigned int color_key;
#endif
// Subtitles font // Subtitles font
bool use_fontconfig; bool use_fontconfig;

View file

@ -452,6 +452,8 @@ void PrefGeneral::on_selectButton_clicked() {
void PrefGeneral::createHelp() { void PrefGeneral::createHelp() {
clearHelp(); clearHelp();
addSectionTitle(tr("General"));
setWhatsThis(mplayerbin_edit, tr("MPlayer executable"), setWhatsThis(mplayerbin_edit, tr("MPlayer executable"),
tr("Here you must specify the mplayer " tr("Here you must specify the mplayer "
"executable that smplayer will use.<br>" "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 " "main window is hidden. When the window is restored, play will be "
"resumed.") ); "resumed.") );
// Video/audio tab addSectionTitle(tr("Video"));
// Video tab
setWhatsThis(eq2_check, tr("Software video equalizer"), setWhatsThis(eq2_check, tr("Software video equalizer"),
tr("You can check this option if video equalizer is not supported by " tr("You can check this option if video equalizer is not supported by "
"your graphic card or the selected video output driver.<br>" "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>" "The screensaver will enabled again when play finishes.<br>"
"<b>Note:</b> This option works only in X11 and Windows.") ); "<b>Note:</b> This option works only in X11 and Windows.") );
addSectionTitle(tr("Audio"));
setWhatsThis(softvol_check, tr("Software volume control"), setWhatsThis(softvol_check, tr("Software volume control"),
tr("Check this option to use the software mixer, instead of " tr("Check this option to use the software mixer, instead of "
"using the sound card mixer.") ); "using the sound card mixer.") );
@ -540,10 +546,6 @@ void PrefGeneral::createHelp() {
setWhatsThis(volnorm_check, tr("Volume normalization by default"), setWhatsThis(volnorm_check, tr("Volume normalization by default"),
tr("Maximizes the volume without distorting the sound.") ); 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"), setWhatsThis(change_volume_check, tr("Change volume"),
tr("If checked, SMPlayer will remember the volume for every file " tr("If checked, SMPlayer will remember the volume for every file "
"and will restore it when played again. For new files the default " "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), " "NOTE: This option is honored by codecs (AC3 only), "
"filters (surround) and audio output drivers (OSS at least).") ); "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"), setWhatsThis(audio_lang_edit, tr("Preferred audio language"),
tr("Here you can type your preferred language for the audio streams. " tr("Here you can type your preferred language for the audio streams. "
"When a media with multiple audio streams is found, smplayer will " "When a media with multiple audio streams is found, smplayer will "

View file

@ -179,6 +179,8 @@ int PrefInput::wheelFunction() {
void PrefInput::createHelp() { void PrefInput::createHelp() {
clearHelp(); clearHelp();
addSectionTitle(tr("Keyboard"));
setWhatsThis(actions_editor, tr("Shortcut editor"), setWhatsThis(actions_editor, tr("Shortcut editor"),
tr("This table allows you to change the key shortcuts of most " tr("This table allows you to change the key shortcuts of most "
"available actions. Double click or press enter on a item, or " "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 " "keys). If the <b>Capture</b> button is off "
"then you could enter the full name of the key.") ); "then you could enter the full name of the key.") );
addSectionTitle(tr("Mouse"));
setWhatsThis(left_click_combo, tr("Left click"), setWhatsThis(left_click_combo, tr("Left click"),
tr("Select the action for left click on the mouse.") ); tr("Select the action for left click on the mouse.") );
setWhatsThis(double_click_combo, tr("Double click"), setWhatsThis(double_click_combo, tr("Double click"),
tr("Select the action for double click on the mouse.") ); 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"), setWhatsThis(wheel_function_combo, tr("Wheel function"),
tr("Select the action for the mouse wheel.") ); tr("Select the action for the mouse wheel.") );
} }

View file

@ -98,6 +98,7 @@ void PrefInterface::createLanguageCombo() {
m["ja"] = tr("Japanese"); m["ja"] = tr("Japanese");
m["ka"] = tr("Georgian"); m["ka"] = tr("Georgian");
m["ko"] = tr("Korean"); m["ko"] = tr("Korean");
m["mk"] = tr("Macedonian");
m["nl"] = tr("Dutch"); m["nl"] = tr("Dutch");
m["pl"] = tr("Polish"); m["pl"] = tr("Polish");
m["pt_BR"] = tr("Portuguese - Brazil"); m["pt_BR"] = tr("Portuguese - Brazil");
@ -415,8 +416,65 @@ void PrefInterface::changeInstanceImages() {
void PrefInterface::createHelp() { void PrefInterface::createHelp() {
clearHelp(); 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"), setWhatsThis(language_combo, tr("Language"),
tr("Here you can change the language of the application.") ); 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" #include "moc_prefinterface.cpp"

View file

@ -201,6 +201,8 @@ bool PrefPerformance::useIdx() {
void PrefPerformance::createHelp() { void PrefPerformance::createHelp() {
clearHelp(); clearHelp();
addSectionTitle(tr("Performance"));
// Performance tab // Performance tab
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
setWhatsThis(priority_combo, tr("Priority"), 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 " "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 " "high bitrate HDTV this provides a big speedup with no visible "
"quality loss.") +"<br>"+ "quality loss.") +"<br>"+
tr("Possible values:") +"<ul><li>" + tr("Possible values:") +"<br>" +
tr("<b>Enabled</b>: the loop filter is not skipped")+"</li><li>"+ tr("<b>Enabled</b>: the loop filter is not skipped")+"<br>"+
tr("<b>Skip (always)</b>: the loop filter is skipped no matter the " 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 " tr("<b>Skip only on HD videos</b>: the loop filter will be "
"skipped only on videos which height is %1 or " "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"), setWhatsThis(autosync_check, tr("Audio/video auto synchronization"),
tr("Gradually adjusts the A/V sync based on audio delay " 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> " "seeking (i.e. not with stdin, pipe, etc).<br> "
"Note: the creation of the index may take some time.") ); "Note: the creation of the index may take some time.") );
addSectionTitle(tr("Cache"));
setWhatsThis(cache_files_spin, tr("Cache for files"), setWhatsThis(cache_files_spin, tr("Cache for files"),
tr("This option specifies how much memory (in kBytes) to use when " tr("This option specifies how much memory (in kBytes) to use when "
"precaching a file.") ); "precaching a file.") );

View file

@ -290,11 +290,49 @@ void PrefSubtitles::on_borderButton_clicked() {
void PrefSubtitles::createHelp() { void PrefSubtitles::createHelp() {
clearHelp(); 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"), setWhatsThis(sub_pos_slider, tr("Subtitle position"),
tr("This option specifies the position of the subtitles over the " tr("This option specifies the position of the subtitles over the "
"video window. <i>100</i> means the bottom, while <i>0</i> means " "video window. <i>100</i> means the bottom, while <i>0</i> means "
"the top." ) ); "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"), setWhatsThis(font_text_scale, tr("Default scale for normal subtitles"),
tr("This option specifies the default font scale for normal (white) " tr("This option specifies the default font scale for normal (white) "
"subtitles which will be used for new videos.")); "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 " tr("This option specifies the default font scale for SSA/ASS "
"subtitles which will be used for new videos.")); "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"), setWhatsThis(ass_styles_edit, tr("SSA/ASS styles"),
tr("Here you can override styles for SSA/ASS subtitles. " tr("Here you can override styles for SSA/ASS subtitles. "
"It can be also used for fine-tuning the rendering of SRT and SUB " "It can be also used for fine-tuning the rendering of SRT and SUB "

View file

@ -37,6 +37,10 @@ QPixmap PrefWidget::sectionIcon() {
return QPixmap(); return QPixmap();
} }
void PrefWidget::addSectionTitle(const QString & title) {
help_message += "<h2>"+title+"</h2>";
}
void PrefWidget::setWhatsThis( QWidget *w, const QString & title, void PrefWidget::setWhatsThis( QWidget *w, const QString & title,
const QString & text) const QString & text)
{ {

View file

@ -51,6 +51,8 @@ protected:
virtual void retranslateStrings(); virtual void retranslateStrings();
virtual void changeEvent ( QEvent * event ) ; virtual void changeEvent ( QEvent * event ) ;
// Help
void addSectionTitle(const QString & title);
void setWhatsThis( QWidget *w, const QString & title, const QString & text); void setWhatsThis( QWidget *w, const QString & title, const QString & text);
void clearHelp(); void clearHelp();

View file

@ -82,16 +82,12 @@ static void initKeyMap()
keyMap[Qt::Key_Up] = "Up"; keyMap[Qt::Key_Up] = "Up";
keyMap[Qt::Key_Right] = "Right"; keyMap[Qt::Key_Right] = "Right";
keyMap[Qt::Key_Down] = "Down"; keyMap[Qt::Key_Down] = "Down";
keyMap[Qt::Key_PageUp] = "PageUp"; keyMap[Qt::Key_PageUp] = "PgUp";
keyMap[Qt::Key_PageDown] = "PageDown"; keyMap[Qt::Key_PageDown] = "PgDown";
keyMap[Qt::Key_CapsLock] = "CapsLock"; keyMap[Qt::Key_CapsLock] = "CapsLock";
keyMap[Qt::Key_NumLock] = "NumLock"; keyMap[Qt::Key_NumLock] = "NumLock";
keyMap[Qt::Key_ScrollLock] = "ScrollLock"; keyMap[Qt::Key_ScrollLock] = "ScrollLock";
// Added by rvm:
keyMap[Qt::Key_Space] = "Space";
keyMap[Qt::Key_Backspace] = "Backspace";
/* /*
These one are quite sure... These one are quite sure...
*/ */
@ -203,6 +199,21 @@ static void initKeyMap()
keyMap[Qt::Key_BraceRight] = "}"; keyMap[Qt::Key_BraceRight] = "}";
keyMap[Qt::Key_AsciiTilde] = "~"; 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) static QString keyToString(int k)

View file

@ -1,6 +1,7 @@
TEMPLATE = lib TEMPLATE = lib
CONFIG += staticlib CONFIG += staticlib
DESTDIR = lib DESTDIR = lib
#TEMPLATE = app
LANGUAGE = C++ LANGUAGE = C++
CONFIG += release CONFIG += release
@ -68,6 +69,7 @@ HEADERS += config.h \
filedialog.h \ filedialog.h \
inputmplayerversion.h \ inputmplayerversion.h \
about.h \ about.h \
errordialog.h \
basegui.h \ basegui.h \
baseguiplus.h \ baseguiplus.h \
floatingwidget.h \ floatingwidget.h \
@ -132,6 +134,7 @@ SOURCES += version.cpp \
filedialog.cpp \ filedialog.cpp \
inputmplayerversion.cpp \ inputmplayerversion.cpp \
about.cpp \ about.cpp \
errordialog.cpp \
basegui.cpp \ basegui.cpp \
baseguiplus.cpp \ baseguiplus.cpp \
floatingwidget.cpp \ floatingwidget.cpp \
@ -139,13 +142,14 @@ SOURCES += version.cpp \
defaultgui.cpp \ defaultgui.cpp \
minigui.cpp \ minigui.cpp \
clhelp.cpp \ clhelp.cpp \
smplayer.cpp smplayer.cpp \
main.cpp
FORMS = inputdvddirectory.ui logwindowbase.ui filepropertiesdialog.ui \ FORMS = inputdvddirectory.ui logwindowbase.ui filepropertiesdialog.ui \
eqslider.ui seekwidget.ui inputurl.ui \ eqslider.ui seekwidget.ui inputurl.ui \
preferencesdialog.ui prefgeneral.ui prefdrives.ui prefinterface.ui \ preferencesdialog.ui prefgeneral.ui prefdrives.ui prefinterface.ui \
prefperformance.ui prefinput.ui prefsubtitles.ui prefadvanced.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 = translations/smplayer_es.ts translations/smplayer_de.ts \
translations/smplayer_sk.ts translations/smplayer_it.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_sv.ts translations/smplayer_sr.ts \
translations/smplayer_zh_TW.ts translations/smplayer_ro_RO.ts \ translations/smplayer_zh_TW.ts translations/smplayer_ro_RO.ts \
translations/smplayer_pt_PT.ts translations/smplayer_el_GR.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 { unix {
UI_DIR = .ui UI_DIR = .ui

View file

@ -40,6 +40,9 @@ QString TrackData::displayName() const {
if (!_name.isEmpty()) { if (!_name.isEmpty()) {
dname = _name; dname = _name;
if (!_lang.isEmpty()) {
dname += " ["+ _lang + "]";
}
} }
else else
if (!_lang.isEmpty()) { 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

View file

@ -44,7 +44,7 @@ public:
signals: signals:
void visibilityChanged(); void visibilityChanged();
protected slots: public slots:
void reset(); void reset();
void setDefaults(); void setDefaults();