From 4f1f048b4c3981feff68e8da0a91d32489230d65 Mon Sep 17 00:00:00 2001 From: llornkcor Date: Mon, 04 Nov 2002 01:16:25 +0000 Subject: add these might help to compile --- (limited to 'core/multimedia/opieplayer/om3u.cpp') diff --git a/core/multimedia/opieplayer/om3u.cpp b/core/multimedia/opieplayer/om3u.cpp new file mode 100644 index 0000000..039f3b1 --- a/dev/null +++ b/core/multimedia/opieplayer/om3u.cpp @@ -0,0 +1,165 @@ +/* +                This file is part of the Opie Project + + Copyright (c) 2002 L. Potter + =. + .=l. +           .>+-= + _;:,     .>    :=|. 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_,=:_.      -`: 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 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 "playlistwidget.h" +#include "om3u.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +//extern PlayListWidget *playList; + +Om3u::Om3u( const QString &filePath, int mode) + : QStringList (){ +//qDebug("<<<<<<0) { + for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { + qDebug(*it); + list += *it+"\n"; + } + f.writeBlock( list, list.length() ); + } +// f.close(); +} + +void Om3u::add(const QString &filePath) { //adds to m3u file + append(filePath); +} + +void Om3u::remove(const QString &filePath) { //removes from m3u list + QString list, currentFile; + if(count()>0) { + for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { + currentFile=*it; + // qDebug(*it); + + if( filePath != currentFile) + list += currentFile+"\n"; + } + f.writeBlock( list, list.length() ); + } +} + +void Om3u::deleteFile(const QString &filePath) {//deletes m3u file + f.close(); + f.remove(); + +} + +void Om3u::close() { //closes m3u file + f.close(); +} -- cgit v0.9.0.2