From 3e34c29f779c920bea0e7322aea18feb2f6dd527 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Fri, 6 Mar 2009 13:19:48 +0000 Subject: mplayer settings git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@823 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/mplayer/CMakeLists.txt | 20 ++--- src/plugins/Input/mplayer/decoder_mplayer.cpp | 16 +++- src/plugins/Input/mplayer/decoder_mplayer.h | 2 +- .../Input/mplayer/decodermplayerfactory.cpp | 11 +-- src/plugins/Input/mplayer/mplayer.pro | 9 +- src/plugins/Input/mplayer/settingsdialog.cpp | 65 ++++++++++++++ src/plugins/Input/mplayer/settingsdialog.h | 46 ++++++++++ src/plugins/Input/mplayer/settingsdialog.ui | 98 ++++++++++++++++++++++ .../mplayer/translations/mplayer_plugin_cs.ts | 57 +++++++++++-- .../mplayer/translations/mplayer_plugin_de.ts | 57 +++++++++++-- .../mplayer/translations/mplayer_plugin_ru.ts | 57 +++++++++++-- .../mplayer/translations/mplayer_plugin_uk_UA.ts | 57 +++++++++++-- .../mplayer/translations/mplayer_plugin_zh_CN.ts | 57 +++++++++++-- .../mplayer/translations/mplayer_plugin_zh_TW.ts | 57 +++++++++++-- 14 files changed, 544 insertions(+), 65 deletions(-) create mode 100644 src/plugins/Input/mplayer/settingsdialog.cpp create mode 100644 src/plugins/Input/mplayer/settingsdialog.h create mode 100644 src/plugins/Input/mplayer/settingsdialog.ui (limited to 'src/plugins/Input/mplayer') diff --git a/src/plugins/Input/mplayer/CMakeLists.txt b/src/plugins/Input/mplayer/CMakeLists.txt index 3cb2bc956..16f657e42 100644 --- a/src/plugins/Input/mplayer/CMakeLists.txt +++ b/src/plugins/Input/mplayer/CMakeLists.txt @@ -28,17 +28,17 @@ link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(libmplayer_SRCS - decoder_mplayer.cpp - decodermplayerfactory.cpp - detailsdialog.cpp -# settingsdialog.cpp + decoder_mplayer.cpp + decodermplayerfactory.cpp + detailsdialog.cpp + settingsdialog.cpp ) SET(libmplayer_MOC_HDRS - decodermplayerfactory.h - decoder_mplayer.h - detailsdialog.h -# settingsdialog.h + decodermplayerfactory.h + decoder_mplayer.h + detailsdialog.h + settingsdialog.h ) SET(libmplayer_RCCS translations/translations.qrc) @@ -51,8 +51,8 @@ QT4_WRAP_CPP(libmplayer_MOC_SRCS ${libmplayer_MOC_HDRS}) SET(libmplayer_UIS -# settingsdialog.ui - detailsdialog.ui + settingsdialog.ui + detailsdialog.ui ) QT4_WRAP_UI(libmplayer_UIS_H ${libmplayer_UIS}) diff --git a/src/plugins/Input/mplayer/decoder_mplayer.cpp b/src/plugins/Input/mplayer/decoder_mplayer.cpp index 44c61184c..45b835a15 100644 --- a/src/plugins/Input/mplayer/decoder_mplayer.cpp +++ b/src/plugins/Input/mplayer/decoder_mplayer.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * + * Copyright (C) 2008-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -34,6 +34,7 @@ #include #include #include +#include #include "decoder_mplayer.h" @@ -110,6 +111,13 @@ bool DecoderMplayer::initialize() delete info; m_args.clear(); m_args << "-slave"; + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + QString ao_str = settings.value("mplayer/ao","default").toString(); + QString vo_str = settings.value("mplayer/vo","default").toString(); + if (ao_str != "default") + m_args << "ao=" + ao_str; + if (vo_str != "default") + m_args << "vo=" + vo_str; m_args << m_url; connect(m_process, SIGNAL(readyReadStandardOutput()), SLOT(readStdOut())); return TRUE; @@ -131,7 +139,7 @@ void DecoderMplayer::stop() if (m_process->state() == QProcess::Running) { m_process->write("quit\n"); - m_process->waitForFinished(200); + m_process->waitForFinished(1500); } StateHandler::instance()->dispatch(Qmmp::Stopped); } @@ -179,13 +187,13 @@ void DecoderMplayer::readStdOut() else if (rx_end.indexIn(line) > -1) { if (m_process->state() == QProcess::Running) - m_process->waitForFinished(500); + m_process->waitForFinished(1500); finish(); } else if (rx_quit.indexIn(line) > -1) { if (m_process->state() == QProcess::Running) - m_process->waitForFinished(500); + m_process->waitForFinished(1500); StateHandler::instance()->dispatch(Qmmp::Stopped); } else if (rx_audio.indexIn(line) > -1) diff --git a/src/plugins/Input/mplayer/decoder_mplayer.h b/src/plugins/Input/mplayer/decoder_mplayer.h index 2a754239e..2fff55ab0 100644 --- a/src/plugins/Input/mplayer/decoder_mplayer.h +++ b/src/plugins/Input/mplayer/decoder_mplayer.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * + * Copyright (C) 2008-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/plugins/Input/mplayer/decodermplayerfactory.cpp b/src/plugins/Input/mplayer/decodermplayerfactory.cpp index acabeda40..28f81663b 100644 --- a/src/plugins/Input/mplayer/decodermplayerfactory.cpp +++ b/src/plugins/Input/mplayer/decodermplayerfactory.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * + * Copyright (C) 2008-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -20,6 +20,7 @@ #include #include "detailsdialog.h" +#include "settingsdialog.h" #include "decoder_mplayer.h" #include "decodermplayerfactory.h" @@ -53,7 +54,7 @@ const DecoderProperties DecoderMplayerFactory::properties() const //properties.contentType = "application/ogg;audio/x-vorbis+ogg"; properties.protocols = "file"; properties.hasAbout = TRUE; - properties.hasSettings = FALSE; + properties.hasSettings = TRUE; properties.noInput = TRUE; properties.noOutput = TRUE; return properties; @@ -82,10 +83,10 @@ QObject* DecoderMplayerFactory::showDetails(QWidget *parent, const QString &path return d; } -void DecoderMplayerFactory::showSettings(QWidget *) +void DecoderMplayerFactory::showSettings(QWidget *parent) { - /*SettingsDialog *s = new SettingsDialog(parent); - s->show();*/ + SettingsDialog *s = new SettingsDialog(parent); + s->show(); } void DecoderMplayerFactory::showAbout(QWidget *parent) diff --git a/src/plugins/Input/mplayer/mplayer.pro b/src/plugins/Input/mplayer/mplayer.pro index c94d7a388..786d4aa71 100644 --- a/src/plugins/Input/mplayer/mplayer.pro +++ b/src/plugins/Input/mplayer/mplayer.pro @@ -2,11 +2,13 @@ include(../../plugins.pri) HEADERS += decodermplayerfactory.h \ decoder_mplayer.h \ - detailsdialog.h + detailsdialog.h \ + settingsdialog.h SOURCES += decoder_mplayer.cpp \ decodermplayerfactory.cpp \ - detailsdialog.cpp + detailsdialog.cpp \ + settingsdialog.cpp TARGET =$$PLUGINS_PREFIX/Input/mplayer QMAKE_CLEAN =$$PLUGINS_PREFIX/Input/libmplayer.so @@ -35,4 +37,5 @@ isEmpty(LIB_DIR){ target.path = $$LIB_DIR/qmmp/Input INSTALLS += target -FORMS += detailsdialog.ui +FORMS += detailsdialog.ui \ + settingsdialog.ui diff --git a/src/plugins/Input/mplayer/settingsdialog.cpp b/src/plugins/Input/mplayer/settingsdialog.cpp new file mode 100644 index 000000000..9dc84088d --- /dev/null +++ b/src/plugins/Input/mplayer/settingsdialog.cpp @@ -0,0 +1,65 @@ +/*************************************************************************** + * Copyright (C) 2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * 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 + +#include + +#include "settingsdialog.h" + +SettingsDialog::SettingsDialog(QWidget *parent) + : QDialog(parent) +{ + ui.setupUi(this); + setAttribute(Qt::WA_DeleteOnClose); + ui.videoComboBox->addItem(tr("default")); + ui.videoComboBox->addItem("xv"); + ui.videoComboBox->addItem("x11"); + ui.videoComboBox->addItem("gl"); + ui.videoComboBox->addItem("gl2"); + ui.videoComboBox->addItem("dga"); + ui.videoComboBox->addItem("sdl"); + ui.videoComboBox->addItem("null"); + ui.audioComboBox->addItem(tr("default")); + ui.audioComboBox->addItem("oss"); + ui.audioComboBox->addItem("alsa"); + ui.audioComboBox->addItem("pulse"); + ui.audioComboBox->addItem("jack"); + ui.audioComboBox->addItem("nas"); + ui.audioComboBox->addItem("null"); + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("mplayer"); + ui.audioComboBox->setEditText(settings.value("ao","default").toString().replace("default", tr("default"))); + ui.videoComboBox->setEditText(settings.value("vo","default").toString().replace("default", tr("default"))); + settings.endGroup(); +} + + +SettingsDialog::~SettingsDialog() +{} + +void SettingsDialog::accept() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("mplayer"); + settings.setValue("ao",ui.audioComboBox->currentText().replace(tr("default"), "default")); + settings.setValue("vo",ui.videoComboBox->currentText().replace(tr("default"), "default")); + settings.endGroup(); + QDialog::accept(); +} diff --git a/src/plugins/Input/mplayer/settingsdialog.h b/src/plugins/Input/mplayer/settingsdialog.h new file mode 100644 index 000000000..9ba56bce8 --- /dev/null +++ b/src/plugins/Input/mplayer/settingsdialog.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (C) 2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * 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 SETTINGSDIALOG_H +#define SETTINGSDIALOG_H + +#include + +#include "ui_settingsdialog.h" + +/** + @author Ilya Kotov +*/ +class SettingsDialog : public QDialog +{ +Q_OBJECT +public: + SettingsDialog(QWidget *parent = 0); + + ~SettingsDialog(); + + +public slots: + virtual void accept(); + +private: + Ui::SettingsDialog ui; +}; + +#endif diff --git a/src/plugins/Input/mplayer/settingsdialog.ui b/src/plugins/Input/mplayer/settingsdialog.ui new file mode 100644 index 000000000..a5faa97be --- /dev/null +++ b/src/plugins/Input/mplayer/settingsdialog.ui @@ -0,0 +1,98 @@ + + + SettingsDialog + + + + 0 + 0 + 229 + 93 + + + + MPlayer Settings + + + + 6 + + + 6 + + + 6 + + + + + Video: + + + + + + + true + + + + + + + Audio: + + + + + + + true + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + SettingsDialog + accept() + + + 199 + 78 + + + 20 + 76 + + + + + buttonBox + rejected() + SettingsDialog + reject() + + + 202 + 78 + + + 40 + 81 + + + + + diff --git a/src/plugins/Input/mplayer/translations/mplayer_plugin_cs.ts b/src/plugins/Input/mplayer/translations/mplayer_plugin_cs.ts index 841f44ae7..ff3bd22eb 100644 --- a/src/plugins/Input/mplayer/translations/mplayer_plugin_cs.ts +++ b/src/plugins/Input/mplayer/translations/mplayer_plugin_cs.ts @@ -1,34 +1,35 @@ - + + DecoderMplayerFactory - + Mplayer Plugin Modul MPlayer - + Video Files Videosoubory - + Writen by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> - + About MPlayer Plugin O modulu MPlayer - + Qmmp MPlayer Plugin Modul Qmmp MPlayer - + This plugin uses MPlayer as backend Tento modul používá jako backend MPlayer @@ -41,6 +42,18 @@ KB + + + + + + + + + + + + - - @@ -86,6 +99,7 @@ Rozlišení: + Bitrate: Datový tok: @@ -101,6 +115,7 @@ FPS: + Codec: Kodek: @@ -131,4 +146,32 @@ Obecné informace + + SettingsDialog + + + + + + + + default + + + + + MPlayer Settings + + + + + Video: + + + + + Audio: + + + diff --git a/src/plugins/Input/mplayer/translations/mplayer_plugin_de.ts b/src/plugins/Input/mplayer/translations/mplayer_plugin_de.ts index eb3de242f..7328ad7d4 100644 --- a/src/plugins/Input/mplayer/translations/mplayer_plugin_de.ts +++ b/src/plugins/Input/mplayer/translations/mplayer_plugin_de.ts @@ -1,35 +1,36 @@ - + + DecoderMplayerFactory - + Mplayer Plugin MPlayer-Plugin - + Video Files Videodateien - + Writen by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> - + About MPlayer Plugin Über MPlayer-Plugin - + Qmmp MPlayer Plugin Qmmp MPlayer-Plugin - + This plugin uses MPlayer as backend Dieses Plugin nutzt MPlayer als Backend @@ -42,6 +43,18 @@ KB + + + + + + + + + + + + - - @@ -87,6 +100,7 @@ Auflösung: + Bitrate: Bitrate: @@ -102,6 +116,7 @@ FPS: + Codec: Codec: @@ -132,4 +147,32 @@ Allgemeine Informationen + + SettingsDialog + + + + + + + + default + + + + + MPlayer Settings + + + + + Video: + + + + + Audio: + + + diff --git a/src/plugins/Input/mplayer/translations/mplayer_plugin_ru.ts b/src/plugins/Input/mplayer/translations/mplayer_plugin_ru.ts index 3033a6cb5..85f2c9120 100644 --- a/src/plugins/Input/mplayer/translations/mplayer_plugin_ru.ts +++ b/src/plugins/Input/mplayer/translations/mplayer_plugin_ru.ts @@ -1,34 +1,35 @@ - + + DecoderMplayerFactory - + Mplayer Plugin Модуль MPlayer - + Video Files Файлы видео - + Writen by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> - + About MPlayer Plugin О модуле MPlayer для Qmmp - + Qmmp MPlayer Plugin Модуль поддержки MPlayer для Qmmp - + This plugin uses MPlayer as backend В этом модуле для воспроизведения используется Mplayer @@ -41,6 +42,18 @@ Закрыть + + + + + + + + + + + + - - @@ -86,6 +99,7 @@ Разрешение: + Bitrate: Битовая частота: @@ -101,6 +115,7 @@ Частота кадров: + Codec: Кодек: @@ -131,4 +146,32 @@ Общая информация + + SettingsDialog + + + + + + + + default + по умолчанию + + + + MPlayer Settings + Настройки MPlayer + + + + Video: + Видео: + + + + Audio: + Аудио: + + diff --git a/src/plugins/Input/mplayer/translations/mplayer_plugin_uk_UA.ts b/src/plugins/Input/mplayer/translations/mplayer_plugin_uk_UA.ts index 7c0e1a174..5f49ff6c8 100644 --- a/src/plugins/Input/mplayer/translations/mplayer_plugin_uk_UA.ts +++ b/src/plugins/Input/mplayer/translations/mplayer_plugin_uk_UA.ts @@ -1,35 +1,36 @@ - + + DecoderMplayerFactory - + Mplayer Plugin Модуль Mplayer - + Video Files Відео файли - + Writen by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> - + About MPlayer Plugin Про модуль Mplayer - + Qmmp MPlayer Plugin Модуль Mplayer для Qmmp - + This plugin uses MPlayer as backend Цей модуль використовує MPlayer як бекенд @@ -42,6 +43,18 @@ Закрити + + + + + + + + + + + + - - @@ -87,6 +100,7 @@ Роздільність: + Bitrate: Бітрейт: @@ -102,6 +116,7 @@ Кадрів в секунду: + Codec: Кодек: @@ -132,4 +147,32 @@ Головна інформація + + SettingsDialog + + + + + + + + default + + + + + MPlayer Settings + + + + + Video: + + + + + Audio: + + + diff --git a/src/plugins/Input/mplayer/translations/mplayer_plugin_zh_CN.ts b/src/plugins/Input/mplayer/translations/mplayer_plugin_zh_CN.ts index b8fe3a013..8d4a129ea 100644 --- a/src/plugins/Input/mplayer/translations/mplayer_plugin_zh_CN.ts +++ b/src/plugins/Input/mplayer/translations/mplayer_plugin_zh_CN.ts @@ -1,34 +1,35 @@ - + + DecoderMplayerFactory - + Mplayer Plugin - + Video Files - + Writen by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> - + About MPlayer Plugin - + Qmmp MPlayer Plugin - + This plugin uses MPlayer as backend @@ -41,6 +42,18 @@ 关闭 + + + + + + + + + + + + - - @@ -86,6 +99,7 @@ + Bitrate: @@ -101,6 +115,7 @@ + Codec: @@ -131,4 +146,32 @@ + + SettingsDialog + + + + + + + + default + + + + + MPlayer Settings + + + + + Video: + + + + + Audio: + + + diff --git a/src/plugins/Input/mplayer/translations/mplayer_plugin_zh_TW.ts b/src/plugins/Input/mplayer/translations/mplayer_plugin_zh_TW.ts index 6599b8d0d..09bae6a2e 100644 --- a/src/plugins/Input/mplayer/translations/mplayer_plugin_zh_TW.ts +++ b/src/plugins/Input/mplayer/translations/mplayer_plugin_zh_TW.ts @@ -1,34 +1,35 @@ - + + DecoderMplayerFactory - + Mplayer Plugin - + Video Files - + Writen by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> - + About MPlayer Plugin - + Qmmp MPlayer Plugin - + This plugin uses MPlayer as backend @@ -41,6 +42,18 @@ 關閉 + + + + + + + + + + + + - - @@ -86,6 +99,7 @@ + Bitrate: @@ -101,6 +115,7 @@ + Codec: @@ -131,4 +146,32 @@ + + SettingsDialog + + + + + + + + default + + + + + MPlayer Settings + + + + + Video: + + + + + Audio: + + + -- cgit v1.2.3-13-gbd6f