summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-05-12 12:15:30 (UTC)
committer llornkcor <llornkcor>2002-05-12 12:15:30 (UTC)
commitc1cc5edca5d6d71350f841892fb7828f7be9ed9f (patch) (side-by-side diff)
tree014224506a39db65d54c41b18c5f7c1096cb7a92
parent06e723cc7942af2691828e7fdc6a6ec47b44edab (diff)
downloadopie-c1cc5edca5d6d71350f841892fb7828f7be9ed9f.zip
opie-c1cc5edca5d6d71350f841892fb7828f7be9ed9f.tar.gz
opie-c1cc5edca5d6d71350f841892fb7828f7be9ed9f.tar.bz2
added a few keyboard shorts
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp133
1 files changed, 130 insertions, 3 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index 038b371..ec5500f 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -36,3 +36,2 @@
#include <qaction.h>
-#include <qcursor.h>
#include <qimage.h>
@@ -53,2 +52,3 @@
#include <qregexp.h>
+#include <qtextstream.h>
@@ -251,2 +251,4 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
+ connect( audioView, SIGNAL( returnPressed( QListViewItem *)),
+ this,SLOT( playIt( QListViewItem *)) );
@@ -271,4 +273,7 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
QPEApplication::setStylusOperation( videoView->viewport(),QPEApplication::RightOnHold);
+
connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) );
+ connect( videoView, SIGNAL( returnPressed( QListViewItem *)),
+ this,SLOT( playIt( QListViewItem *)) );
@@ -836,2 +841,3 @@ void PlayListWidget::btnPlay(bool b) {
{
+// if(audioView->selectedItem()) {
addToSelection( audioView->selectedItem() );
@@ -843,2 +849,3 @@ void PlayListWidget::btnPlay(bool b) {
// audioView->clearSelection();
+// }
}
@@ -847,2 +854,3 @@ void PlayListWidget::btnPlay(bool b) {
{
+// if(videoView->selectedItem() ) {
addToSelection( videoView->selectedItem() );
@@ -855,2 +863,3 @@ void PlayListWidget::btnPlay(bool b) {
// videoView->clearSelection();
+// }
}
@@ -885,3 +894,5 @@ void PlayListWidget::viewPressed( int mouse, QListViewItem *item, const QPoint&
m.insertSeparator();
+ if( QFile(QPEApplication::qpeDir()+"lib/libopie.so").exists() )
m.insertItem( tr( "Properties" ), this, SLOT( listDelete() ));
+
m.exec( QCursor::pos() );
@@ -909,2 +920,3 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const
// m.insertSeparator();
+// m.insertItem( tr( "Properties" ), this, SLOT( listDelete() ));
m.exec( QCursor::pos() );
@@ -987,2 +999,3 @@ void PlayListWidget::populateAudioView() {
}
+
}
@@ -1022,3 +1035,3 @@ void PlayListWidget::openFile() {
// http://66.28.68.70:8000
- qDebug(filename);
+ qDebug("Selected filename is "+filename);
if(filename.right(3) == "m3u")
@@ -1070,3 +1083,29 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e)
break;
-
+ case Key_Q: //add to playlist
+ qDebug("Add");
+ addSelected();
+ break;
+ case Key_R: //remove from playlist
+ removeSelected();
+ break;
+// case Key_P: //play
+// qDebug("Play");
+// playSelected();
+// break;
+ case Key_Space:
+ qDebug("Play");
+ playSelected();
+ break;
+ case Key_1:
+ tabWidget->setCurrentPage(0);
+ break;
+ case Key_2:
+ tabWidget->setCurrentPage(1);
+ break;
+ case Key_3:
+ tabWidget->setCurrentPage(2);
+ break;
+ case Key_4:
+ tabWidget->setCurrentPage(3);
+ break;
}
@@ -1074,2 +1113,25 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e)
+void PlayListWidget::keyPressEvent( QKeyEvent *e)
+{
+// qDebug("Key press");
+// switch ( e->key() ) {
+// ////////////////////////////// Zaurus keys
+// case Key_A: //add to playlist
+// qDebug("Add");
+// addSelected();
+// break;
+// case Key_R: //remove from playlist
+// removeSelected();
+// break;
+// case Key_P: //play
+// qDebug("Play");
+// playSelected();
+// break;
+// case Key_Space:
+// qDebug("Play");
+// playSelected();
+// break;
+// }
+}
+
void PlayListWidget::doBlank() {
@@ -1098,2 +1160,44 @@ void PlayListWidget::readm3u(const QString &filename) {
+ qDebug("playlist filename is "+filename);
+ QFile f(filename);
+
+ if(f.open(IO_ReadOnly)) {
+ QTextStream t(&f);
+ QString s;//, first, second;
+ int i=0;
+ while ( !t.atEnd()) {
+// Lview->insertLine(t.readLine(),-1);
+ s=t.readLine();
+ if(s.find("#",0,TRUE) == -1) {
+ if(s.find(" ",0,TRUE) == -1) { // not sure if this is neede since cf uses vfat
+ if(s.left(2) == "E:" || s.left(2) == "P:") {
+ s=s.right(s.length()-2);
+ DocLnk lnk( s );
+ QFileInfo f(s);
+ QString name = f.baseName();
+ name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1);
+ lnk.setName( name);
+ s=s.replace( QRegExp("\\"),"/");
+ lnk.setFile( s);
+// lnk.setIcon(opieplayer/MPEGPlayer);
+ qDebug("add "+name);
+ d->selectedFiles->addToSelection( lnk);
+ } else { // is url
+ DocLnk lnk( s);
+ QString name = s.right( s.length() - 7);
+// name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1);
+ lnk.setName(name);
+ lnk.setFile( s+"/");
+// lnk.setFile( filename);
+// lnk.setComment( s+"/");
+ lnk.setType("audio/x-mpegurl");
+// lnk.setIcon( "opieplayer/MPEGPlayer");
+// qDebug("add "+s);
+ d->selectedFiles->addToSelection( lnk);
+ }
+ i++;
+ }
+ }
+ }
+ }
}
@@ -1106,2 +1210,25 @@ void PlayListWidget::readPls(const QString &filename) {
+ qDebug("playlist filename is "+filename);
+ QFile f(filename);
+
+ if(f.open(IO_ReadOnly)) {
+ QTextStream t(&f);
+ QString s;//, first, second;
+ int i=0;
+ while ( !t.atEnd()) {
+// Lview->insertLine(t.readLine(),-1);
+// s=t.readLine();
+// s=s.right(s.length()-2);
+// DocLnk lnk( s );
+// QFileInfo f(s);
+// QString name = f.baseName();
+// // name = name.left(name.length()-4);
+// name = name.right(name.findRev("/",0,TRUE));
+// lnk.setName( name);
+// lnk.setFile( s);
+// qDebug("add "+name);
+// d->selectedFiles->addToSelection( lnk);
+ }
+ i++;
+ }
}