summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2004-03-16 11:04:20 (UTC)
committer llornkcor <llornkcor>2004-03-16 11:04:20 (UTC)
commit523022a20006312ac8573628b556d749dab3ec78 (patch) (side-by-side diff)
treeb407795a5e7e166bb6f28ede675d191802c80846
parent2785830c856cb224b16e9a09cace2fbe3d76b466 (diff)
downloadopie-523022a20006312ac8573628b556d749dab3ec78.zip
opie-523022a20006312ac8573628b556d749dab3ec78.tar.gz
opie-523022a20006312ac8573628b556d749dab3ec78.tar.bz2
fix ogg
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index efb5df3..3609f5d 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -21,97 +21,97 @@
#define QTOPIA_INTERNAL_FSLP
#include <qtoolbar.h>
#include <qpe/qpemenubar.h>
#include <qpe/lnkproperties.h>
#include <qaction.h>
#include <qlayout.h>
#include <qmessagebox.h>
//#include <qtimer.h>
#include "playlistselection.h"
#include "playlistwidget.h"
#include "mediaplayerstate.h"
#include "inputDialog.h"
#include <stdlib.h>
#include "audiowidget.h"
#include "videowidget.h"
#include <unistd.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/soundcard.h>
// for setBacklight()
#include <linux/fb.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#define BUTTONS_ON_TOOLBAR
#define SIDE_BUTTONS
#define CAN_SAVE_LOAD_PLAYLISTS
extern AudioWidget *audioUI;
extern VideoWidget *videoUI;
extern MediaPlayerState *mediaPlayerState;
static inline QString fullBaseName ( const QFileInfo &fi )
{
QString str = fi. fileName ( );
return str. left ( str. findRev ( '.' ));
}
-QString audioMimes ="audio/mpeg;audio/x-wav;application/ogg;audio/x-mod";
+QString audioMimes ="audio/mpeg;audio/x-wav;audio/x-ogg;audio/x-mod";
// class myFileSelector {
// };
class PlayListWidgetPrivate {
public:
QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove;
QFrame *playListFrame;
FileSelector *files;
PlayListSelection *selectedFiles;
bool setDocumentUsed;
DocLnk *current;
};
class ToolButton : public QToolButton {
public:
ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE )
: QToolButton( parent, name ) {
setTextLabel( name );
setPixmap( Resource::loadPixmap( icon ) );
setAutoRaise( TRUE );
setFocusPolicy( QWidget::NoFocus );
setToggleButton( t );
connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot );
QPEMenuToolFocusManager::manager()->addWidget( this );
}
};
class MenuItem : public QAction {
public:
MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot )
: QAction( text, QString::null, 0, 0 ) {
connect( this, SIGNAL( activated() ), handler, slot );
addTo( parent );
}
};
PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
: QMainWindow( parent, name, fl ) {
d = new PlayListWidgetPrivate;
d->setDocumentUsed = FALSE;
d->current = NULL;
fromSetDocument = FALSE;
insanityBool=FALSE;
audioScan = FALSE;
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 1a5e474..4460833 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -620,97 +620,97 @@ void PlayListWidget::openURL() {
if(filename.left(4) == "http") {
QString m3uFile, m3uFilePath;
if(filename.find(":",8,TRUE) != -1) { //found a port
m3uFile = filename.left( filename.find( ":",8,TRUE));
m3uFile = m3uFile.right( 7);
} else if(filename.left(4) == "http"){
m3uFile=filename;
m3uFile = m3uFile.right( m3uFile.length() - 7);
} else{
m3uFile=filename;
}
lnk.setName( filename ); //sets name
lnk.setFile( filename ); //sets file name
// lnk.setIcon("opieplayer2/musicfile");
d->selectedFiles->addToSelection( lnk );
writeCurrentM3u();
d->selectedFiles->setSelectedItem( lnk.name());
}
else if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) {
readListFromFile( filename );
} else {
lnk.setName( QFileInfo(filename).baseName() ); //sets name
lnk.setFile( filename ); //sets file name
d->selectedFiles->addToSelection( lnk);
writeCurrentM3u();
d->selectedFiles->setSelectedItem( lnk.name());
}
}
delete fileDlg;
}
void PlayListWidget::openFile() {
QString filename, name;
Config cfg( "OpiePlayer" );
cfg.setGroup("Dialog");
MimeTypes types;
QStringList audio, video, all;
audio << "audio/*";
audio << "playlist/plain";
- audio << "application/ogg";
+ audio << "audio/x-ogg";
audio << "audio/x-mpegurl";
video << "video/*";
video << "playlist/plain";
all += audio;
all += video;
types.insert("All Media Files", all );
types.insert("Audio", audio );
types.insert("Video", video );
QString str = OFileDialog::getOpenFileName( 1,
cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"",
types, 0 );
if(str.left(2) == "//") {
str=str.right(str.length()-1);
}
cfg.writeEntry( "LastDirectory" ,QFileInfo( str ).dirPath() );
if( !str.isEmpty() ) {
qDebug( "Selected filename is " + str );
filename = str;
DocLnk lnk;
if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) {
readListFromFile( filename );
} else {
lnk.setName( QFileInfo(filename).baseName() ); //sets name
lnk.setFile( filename ); //sets file name
d->selectedFiles->addToSelection( lnk );
writeCurrentM3u();
d->selectedFiles->setSelectedItem( lnk.name() );
}
}
}
void PlayListWidget::readListFromFile( const QString &filename ) {
qDebug( "read list filename " + filename );
QFileInfo fi(filename);
Om3u *m3uList;
QString s, name;
m3uList = new Om3u( filename, IO_ReadOnly );
if(fi.extension(false).find("m3u",0,false) != -1 )
m3uList->readM3u();
else if(fi.extension(false).find("pls",0,false) != -1 )