summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer3/mwindow.cpp38
-rw-r--r--noncore/multimedia/opieplayer3/playlist.cpp2
2 files changed, 25 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer3/mwindow.cpp b/noncore/multimedia/opieplayer3/mwindow.cpp
index 0898c7b..982d732 100644
--- a/noncore/multimedia/opieplayer3/mwindow.cpp
+++ b/noncore/multimedia/opieplayer3/mwindow.cpp
@@ -12,66 +12,66 @@
:`=1 )Y*s>-.-- : the terms of the GNU General Public
.="- .-=="i, .._ License as published by the Free Software
- . .-<_> .<> Foundation; either version 2 of the License,
._= =} : or (at your option) any later version.
.%`+i> _;_.
.i_,=:_. -<s. 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
..}^=.= = ; Library General Public License for more
++= -. .` .: details.
: = ...= . :.=-
-. .:....=;==+<; You should have received a copy of the GNU
-_. . . )=. = Library General Public License along with
-- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "mwindow.h"
#include "playlist.h"
#include "audiowidget.h"
#include "videowidget.h"
#include "../opieplayer2/lib.h"
#include <opie2/oapplicationfactory.h>
#include <opie2/owidgetstack.h>
#include <opie2/ofileselector.h>
#include <opie2/odebug.h>
+#include <opie2/oresource.h>
-#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
#include <qfileinfo.h>
#include <qfile.h>
#include <qtoolbar.h>
#include <qpopupmenu.h>
#include <qmenubar.h>
#include <qtimer.h>
#include <qslider.h>
#include <qlayout.h>
OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>)
using namespace Opie::Ui;
PMainWindow::PMainWindow(QWidget*w, const char*name, WFlags f)
: QMainWindow(w,name,f)
{
checkLib();
setCaption(appTitle());
m_MainBox = new QWidget(this);
QVBoxLayout*m_l = new QVBoxLayout(m_MainBox);
m_stack = new OWidgetStack(m_MainBox);
m_stack->forceMode(Opie::Ui::OWidgetStack::SmallScreen);
m_l->addWidget(m_stack);
m_PosSlider = new QSlider(QSlider::Horizontal,m_MainBox);
m_l->addWidget(m_PosSlider);
m_PosSlider->setEnabled(false);
@@ -300,114 +300,126 @@ void PMainWindow::slotPlayPrevious()
}
void PMainWindow::slotStopped()
{
if (!m_playing) return;
odebug << "Slot stopped" << oendl;
m_playing = false;
slotGoNext();
}
void PMainWindow::slotCheckPos()
{
if (!m_playing) return;
if (!m_pressed) {
m_uppos = m_PlayLib->currentTime();
emit sigPos(m_uppos);
m_PosSlider->setValue(m_PlayLib->currentTime());
}
qApp->processEvents(100);
QTimer::singleShot( 900, this, SLOT( slotCheckPos() ) );
}
void PMainWindow::slotRemoveFiles()
{
if (m_playing||!m_playList->isVisible()) return;
PlaylistItem* Item = m_playList->currentItem();
slotShowList();
m_playList->removeFromList(Item);
}
void PMainWindow::setupActions()
{
- a_appendFiles = new QAction(tr("Append file(s)"),Resource::loadIconSet( "opieplayer2/add_to_playlist" ), 0, 0, this, 0, false );
+ a_appendFiles = new QAction(tr("Append file(s)"),Opie::Core::OResource::loadPixmap( "opieplayer2/add_to_playlist",
+ Opie::Core::OResource::SmallIcon ), 0, 0, this, 0, false );
connect(a_appendFiles,SIGNAL(activated()),this,SLOT(slotAppendFiles()));
- a_addDir = new QAction(tr("Add directory"),Resource::loadIconSet("folder_open"),0,0,this,0,false);
+ a_addDir = new QAction(tr("Add directory"),Opie::Core::OResource::loadPixmap("folder_open",
+ Opie::Core::OResource::SmallIcon),0,0,this,0,false);
connect(a_addDir,SIGNAL(activated()),m_playList,SLOT(slotAppendDir()));
- a_loadPlaylist = new QAction(tr("Append playlist"),Resource::loadIconSet("opieplayer2/add_to_playlist"),0,0,this,0,false);
+ a_loadPlaylist = new QAction(tr("Append playlist"),Opie::Core::OResource::loadPixmap("opieplayer2/add_to_playlist",
+ Opie::Core::OResource::SmallIcon),0,0,this,0,false);
connect(a_loadPlaylist,SIGNAL(activated()),m_playList,SLOT(slotOpenM3u()));
- a_savePlaylist = new QAction(tr("Save playlist"),Resource::loadIconSet("save"),0,0,this,0,false);
+ a_savePlaylist = new QAction(tr("Save playlist"),Opie::Core::OResource::loadPixmap("save",
+ Opie::Core::OResource::SmallIcon),0,0,this,0,false);
connect(a_savePlaylist,SIGNAL(activated()),m_playList,SLOT(slotSaveAsM3u()));
playlistOnly = new QActionGroup(this,"playlistgroup",false);
playlistOnly->insert(a_appendFiles);
playlistOnly->insert(a_addDir);
playlistOnly->insert(a_loadPlaylist);
playlistOnly->insert(a_savePlaylist);
- a_showPlaylist = new QAction(tr("Show playlist"),Resource::loadIconSet( "txt" ), 0, 0, this, 0, false );
+ a_showPlaylist = new QAction(tr("Show playlist"),Opie::Core::OResource::loadPixmap( "txt",
+ Opie::Core::OResource::SmallIcon ), 0, 0, this, 0, false );
connect(a_showPlaylist,SIGNAL(activated()),this,SLOT(slotShowList()));
- a_ShowMedia = new QAction(tr("Show media window"),Resource::loadIconSet("opieplayer2/musicfile"), 0, 0, this, 0, false );
+ a_ShowMedia = new QAction(tr("Show media window"),Opie::Core::OResource::loadPixmap("opieplayer2/musicfile",
+ Opie::Core::OResource::SmallIcon), 0, 0, this, 0, false );
connect(a_ShowMedia,SIGNAL(activated()),this,SLOT(slotShowMediaWindow()));
- a_removeFiles = new QAction(tr("Remove file"),Resource::loadIconSet( "opieplayer2/remove_from_playlist" ), 0, 0, this, 0, false );
+ a_removeFiles = new QAction(tr("Remove file"),Opie::Core::OResource::loadPixmap( "opieplayer2/remove_from_playlist",
+ Opie::Core::OResource::SmallIcon), 0, 0, this, 0, false );
connect(a_removeFiles,SIGNAL(activated()),this,SLOT(slotRemoveFiles()));
playersGroup = new QActionGroup(this,"playgroup",false);
- a_playAction = new QAction(tr("Play list"),Resource::loadIconSet( "opieplayer2/play" ), 0, 0, this, 0, true);
+ a_playAction = new QAction(tr("Play list"),Opie::Core::OResource::loadPixmap( "opieplayer2/play",
+ Opie::Core::OResource::SmallIcon ), 0, 0, this, 0, true);
a_playAction->setOn(false);
connect(a_playAction,SIGNAL(toggled(bool)),this,SLOT(slotTogglePlay(bool)));
- a_playNext = new QAction(tr("Play next in list"),Resource::loadIconSet( "fastforward" ), 0, 0, this, 0, false );
+ a_playNext = new QAction(tr("Play next in list"),Opie::Core::OResource::loadPixmap( "fastforward",
+ Opie::Core::OResource::SmallIcon ), 0, 0, this, 0, false );
connect(a_playNext,SIGNAL(activated()),this,SLOT(slotPlayNext()));
- a_playPrevious = new QAction(tr("Play previous in list"),Resource::loadIconSet( "fastback" ), 0, 0, this, 0, false );
+ a_playPrevious = new QAction(tr("Play previous in list"),Opie::Core::OResource::loadPixmap( "fastback",
+ Opie::Core::OResource::SmallIcon ), 0, 0, this, 0, false );
connect(a_playPrevious,SIGNAL(activated()),this,SLOT(slotPlayPrevious()));
- a_ShowFull = new QAction(tr("Show videos fullscreen"),Resource::loadIconSet( "fullscreen" ), 0, 0, this, 0, true );
+ a_ShowFull = new QAction(tr("Show videos fullscreen"),Opie::Core::OResource::loadPixmap( "fullscreen",
+ Opie::Core::OResource::SmallIcon ), 0, 0, this, 0, true );
connect(a_ShowFull,SIGNAL(toggled(bool)),this,SLOT(slotToggleFull(bool)));
playersGroup->insert(a_playPrevious);
playersGroup->insert(a_playAction);
playersGroup->insert(a_playNext);
/* initial states of actions */
a_showPlaylist->setEnabled(false);
a_removeFiles->setEnabled(false);
a_ShowMedia->setEnabled(false);
playersGroup->setEnabled(false);
settingsGroup = new QActionGroup(this,"configgroup",false);
- a_Scaleup = new QAction(tr("Scale videos larger"),Resource::loadIconSet( "fullscreen" ), 0, 0, this, 0, true );
+ a_Scaleup = new QAction(tr("Scale videos larger"),Opie::Core::OResource::loadPixmap( "fullscreen",
+ Opie::Core::OResource::SmallIcon ), 0, 0, this, 0, true );
connect(a_Scaleup,SIGNAL(toggled(bool)),this,SLOT(slot_scaleupToggled(bool)));
settingsGroup->insert(a_Scaleup);
}
void PMainWindow::setupToolBar()
{
setToolBarsMovable( false );
m_toolBar = new QToolBar( this );
//m_menuBar = new QMenuBar(m_toolBar);
m_menuBar=menuBar();
addToolBar(m_toolBar);
m_toolBar->setHorizontalStretchable( true );
a_appendFiles->addTo(m_toolBar);
a_removeFiles->addTo(m_toolBar);
a_showPlaylist->addTo(m_toolBar);
a_ShowMedia->addTo(m_toolBar);
a_ShowFull->addTo(m_toolBar);
playersGroup->addTo(m_toolBar);
}
void PMainWindow::setupVideo(bool full)
{
if (full) {
m_VideoPlayer->setBackgroundColor(black);
m_VideoPlayer->reparent(0, WStyle_Customize | WStyle_NoBorderEx, QPoint(0,0));
m_VideoPlayer->setGeometry(0,0,qApp->desktop()->size().width(),qApp->desktop()->size().height());
m_VideoPlayer->showFullScreen();
connect(m_VideoPlayer,SIGNAL(videoclicked()),this,SLOT(slotVideoclicked()));
} else {
m_VideoPlayer->hide();
m_VideoPlayer->disconnect(this);
m_stack->addWidget(m_VideoPlayer,stack_video);
diff --git a/noncore/multimedia/opieplayer3/playlist.cpp b/noncore/multimedia/opieplayer3/playlist.cpp
index fe2dde3..eebb068 100644
--- a/noncore/multimedia/opieplayer3/playlist.cpp
+++ b/noncore/multimedia/opieplayer3/playlist.cpp
@@ -9,66 +9,64 @@
.>+-=
_;:, .> :=|. This program is free software; you can
.> <`_, > . <= redistribute it and/or modify it under
:`=1 )Y*s>-.-- : the terms of the GNU General Public
.="- .-=="i, .._ License as published by the Free Software
- . .-<_> .<> Foundation; either version 2 of the License,
._= =} : or (at your option) any later version.
.%`+i> _;_.
.i_,=:_. -<s. 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
..}^=.= = ; Library General Public License for more
++= -. .` .: details.
: = ...= . :.=-
-. .:....=;==+<; You should have received a copy of the GNU
-_. . . )=. = Library General Public License along with
-- :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "playlist.h"
#include "../opieplayer2/lib.h"
#include "../opieplayer2/om3u.h"
#include <opie2/odebug.h>
#include <opie2/oresource.h>
#include <opie2/ofiledialog.h>
-#include <qpe/resource.h>
-
#include <qfileinfo.h>
#include <qmessagebox.h>
#include <qdir.h>
//#define DEFAULT_FILE_TYPES "*.mp3;*.ogg;*.ogm;*.wma;*.wav;*.asf;*.au;*.avi;*.mpeg;*.mpg;*.mv1;*.mov;*.wmv;*.pls;*.m3u;*.mp4;*.m4a"
#define DEFAULT_FILE_TYPES "*.mp3;*.ogg;*.ogm;*.wma;*.wav;*.asf;*.au;*.avi;*.mpeg;*.mpg;*.mv1;*.mov;*.wmv;*.mp4;*.m4a"
PlaylistItem::PlaylistItem(const DocLnk& aLink,PlaylistView*parent)
:QListViewItem(parent),m_Content(aLink),m_video(false)
{
}
PlaylistItem::PlaylistItem(const DocLnk&aLink,PlaylistView*parent,PlaylistItem*after)
:QListViewItem(parent,after),m_Content(aLink),m_video(false)
{
}
void PlaylistItem::Video(bool y)
{
m_video=y;
if (m_video) {
setPixmap(0,Opie::Core::OResource::loadPixmap("opieplayer2/videofile"));
} else {
setPixmap(0,Opie::Core::OResource::loadPixmap("opieplayer2/musicfile"));
}
}
PlaylistItem::~PlaylistItem()
{
}
/* PlaylistView Methods */