Skip to content

Commit

Permalink
Reborn on Qt5
Browse files Browse the repository at this point in the history
  • Loading branch information
blackPantherOS committed May 31, 2020
1 parent 3bec0d4 commit c9d2800
Show file tree
Hide file tree
Showing 14 changed files with 903 additions and 903 deletions.
496 changes: 248 additions & 248 deletions src/micelanea/Aleatorio.cpp

Large diffs are not rendered by default.

80 changes: 40 additions & 40 deletions src/micelanea/Aleatorio.h
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
/**
* Aleatorio
* -----------------------------------------
*
* - Implements random systems
* - avoid repetition of audios files
*
* @author Victor Algaba
*/
#ifndef ALEATORIO_H
#define ALEATORIO_H

#include <QDirModel>
#include <QStatusBar>
#include <QVariant>
#include <QLabel>
#include <QFileSystemModel>

class Aleatorio
{
private:
QList<QString> results;
QList<int> Sacado;
QString Path;
int TotalFicheros;
int NumeroAleatorio(int range_starts, int range_ends); //get random number
bool Repetido(int numero);//checks whether the file was repeated
void Todos();// If they are all set to 0 reproducios index
void Nuevo(int ultimo);//marks the last for us to be the first
void CrearIndice(const QString url);
void DeleteIndex();
double Count(const QString url);

public:
Aleatorio(const QString url,QLabel *w_Label);
~Aleatorio();
QString FicheroPath();
QString Cancion; //para los titulos
};
#endif // ALEATORIO_H
/**
* Aleatorio
* -----------------------------------------
*
* - Implements random systems
* - avoid repetition of audios files
*
* @author Victor Algaba
*/
#ifndef ALEATORIO_H
#define ALEATORIO_H

#include <QDirModel>
#include <QStatusBar>
#include <QVariant>
#include <QLabel>
#include <QFileSystemModel>

class Aleatorio
{
private:
QList<QString> results;
QList<int> Sacado;
QString Path;
int TotalFicheros;
int NumeroAleatorio(int range_starts, int range_ends); //get random number
bool Repetido(int numero);//checks whether the file was repeated
void Todos();// If they are all set to 0 reproducios index
void Nuevo(int ultimo);//marks the last for us to be the first
void CrearIndice(const QString url);
void DeleteIndex();
double Count(const QString url);

public:
Aleatorio(const QString url,QLabel *w_Label);
~Aleatorio();
QString FicheroPath();
QString Cancion; //para los titulos
};
#endif // ALEATORIO_H
214 changes: 107 additions & 107 deletions src/micelanea/AleatorioIndice.cpp
Original file line number Diff line number Diff line change
@@ -1,107 +1,107 @@
/****************************************************************************
**
** Copyright (C) 2010 Victor Algaba .
** All rights reserved.
** Contact: (www.radit.org)
**
** *************************************************************************
**Crea un fichero indice.dat
**
**
****************************************************************************/
#include <QDirIterator>
#include <QList>
#include <QDebug>

#include "AleatorioIndice.h"



AleatorioIndice::AleatorioIndice(const QString url){

urlx=url;


QFile fexiste( url + "/index.dat" );
if(fexiste.exists())
return;
fexiste.close();






QList<QString> list;

QStringList filters;
filters << "*.mp3" << "*.mp2" << "*.mp1" << "*.ogg" << "*.wav" << "*.aif" <<"*.wma" <<"*.flac";
QDirIterator it(url,filters, QDir::Files|QDir::NoSymLinks, QDirIterator::Subdirectories);


while (it.hasNext()) {
QString qstr = it.next();
list << qstr ;

}


QFile file( url + "/index.dat" );
if( !file.open( QIODevice::WriteOnly ) )
return;

QDataStream stream( &file );
stream.setVersion( QDataStream::Qt_4_2 );

stream << list;

file.close();









}

//*******************************************************************************

AleatorioIndice::~AleatorioIndice(){



}

//*****************************************************************************
QDataStream AleatorioIndice::Load(){

QList<QString> list;

QFile file( urlx + "/test.dat");
file.open( QIODevice::ReadOnly );

QDataStream stream( &file );
stream.setVersion( QDataStream::Qt_4_2 );

stream >> list;

file.close();


//qDebug() << list[0];
//qDebug() << list[1];







}




/****************************************************************************
**
** Copyright (C) 2010 Victor Algaba .
** All rights reserved.
** Contact: (www.blackpanther.hu)
**
** *************************************************************************
**Crea un fichero indice.dat
**
**
****************************************************************************/
#include <QDirIterator>
#include <QList>
#include <QDebug>

#include "AleatorioIndice.h"



AleatorioIndice::AleatorioIndice(const QString url){

urlx=url;


QFile fexiste( url + "/index.dat" );
if(fexiste.exists())
return;
fexiste.close();






QList<QString> list;

QStringList filters;
filters << "*.mp3" << "*.mp2" << "*.mp1" << "*.ogg" << "*.wav" << "*.aif" <<"*.wma" <<"*.flac";
QDirIterator it(url,filters, QDir::Files|QDir::NoSymLinks, QDirIterator::Subdirectories);


while (it.hasNext()) {
QString qstr = it.next();
list << qstr ;

}


QFile file( url + "/index.dat" );
if( !file.open( QIODevice::WriteOnly ) )
return;

QDataStream stream( &file );
stream.setVersion( QDataStream::Qt_4_2 );

stream << list;

file.close();









}

//*******************************************************************************

AleatorioIndice::~AleatorioIndice(){



}

//*****************************************************************************
QDataStream AleatorioIndice::Load(){

QList<QString> list;

QFile file( urlx + "/test.dat");
file.open( QIODevice::ReadOnly );

QDataStream stream( &file );
stream.setVersion( QDataStream::Qt_4_2 );

stream >> list;

file.close();


//qDebug() << list[0];
//qDebug() << list[1];







}




0 comments on commit c9d2800

Please sign in to comment.