mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-24 06:33:04 +02:00
Style fixes
This commit is contained in:
@@ -22,9 +22,8 @@
|
|||||||
#ifndef AUDIOOUTPUT_H
|
#ifndef AUDIOOUTPUT_H
|
||||||
#define AUDIOOUTPUT_H
|
#define AUDIOOUTPUT_H
|
||||||
|
|
||||||
#include "../Typedefs.h"
|
|
||||||
|
|
||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
#include "Typedefs.h"
|
||||||
#include "utils/MediaStream.h"
|
#include "utils/MediaStream.h"
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@@ -41,24 +40,24 @@ Q_OBJECT
|
|||||||
public:
|
public:
|
||||||
enum AudioState { Stopped = 0, Playing = 1, Paused = 2, Error = 3, Loading = 4, Buffering = 5 };
|
enum AudioState { Stopped = 0, Playing = 1, Paused = 2, Error = 3, Loading = 4, Buffering = 5 };
|
||||||
|
|
||||||
explicit AudioOutput(QObject* parent = 0);
|
explicit AudioOutput( QObject* parent = nullptr );
|
||||||
~AudioOutput();
|
~AudioOutput();
|
||||||
|
|
||||||
AudioState state();
|
AudioState state();
|
||||||
|
|
||||||
void setCurrentSource( const QUrl& stream);
|
void setCurrentSource( const QUrl& stream );
|
||||||
void setCurrentSource( QIODevice* stream);
|
void setCurrentSource( QIODevice* stream );
|
||||||
void setCurrentSource( MediaStream* stream );
|
void setCurrentSource( MediaStream* stream );
|
||||||
|
|
||||||
void play();
|
void play();
|
||||||
void pause();
|
void pause();
|
||||||
void stop();
|
void stop();
|
||||||
void seek(qint64 milliseconds);
|
void seek( qint64 milliseconds );
|
||||||
|
|
||||||
bool isSeekable();
|
bool isSeekable();
|
||||||
bool isMuted();
|
bool isMuted();
|
||||||
void setMuted(bool m);
|
void setMuted( bool m );
|
||||||
void setVolume(qreal vol);
|
void setVolume( qreal vol );
|
||||||
qreal volume();
|
qreal volume();
|
||||||
qint64 currentTime();
|
qint64 currentTime();
|
||||||
qint64 totalTime();
|
qint64 totalTime();
|
||||||
|
@@ -30,8 +30,7 @@ static QString s_aeInfoIdentifier = QString( "MEDIASTREAM" );
|
|||||||
MediaStream::MediaStream( QObject* parent )
|
MediaStream::MediaStream( QObject* parent )
|
||||||
: QObject( parent )
|
: QObject( parent )
|
||||||
, m_type( Unknown )
|
, m_type( Unknown )
|
||||||
, m_url( QUrl() )
|
, m_ioDevice ( nullptr )
|
||||||
, m_ioDevice ( 0 )
|
|
||||||
, m_started( false )
|
, m_started( false )
|
||||||
, m_bufferingFinished( false )
|
, m_bufferingFinished( false )
|
||||||
, m_eos( false )
|
, m_eos( false )
|
||||||
@@ -39,14 +38,14 @@ MediaStream::MediaStream( QObject* parent )
|
|||||||
, m_streamSize( 0 )
|
, m_streamSize( 0 )
|
||||||
{
|
{
|
||||||
tDebug() << Q_FUNC_INFO;
|
tDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MediaStream::MediaStream( const QUrl &url )
|
MediaStream::MediaStream( const QUrl &url )
|
||||||
: QObject( 0 )
|
: QObject( 0 )
|
||||||
, m_type( Url )
|
, m_type( Url )
|
||||||
, m_ioDevice ( 0 )
|
, m_url( url )
|
||||||
|
, m_ioDevice ( nullptr )
|
||||||
, m_started( false )
|
, m_started( false )
|
||||||
, m_bufferingFinished( false )
|
, m_bufferingFinished( false )
|
||||||
, m_eos( false )
|
, m_eos( false )
|
||||||
@@ -54,16 +53,13 @@ MediaStream::MediaStream( const QUrl &url )
|
|||||||
, m_streamSize( 0 )
|
, m_streamSize( 0 )
|
||||||
{
|
{
|
||||||
tDebug() << Q_FUNC_INFO;
|
tDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
m_url = url;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MediaStream::MediaStream( QIODevice* device )
|
MediaStream::MediaStream( QIODevice* device )
|
||||||
: QObject( 0 )
|
: QObject( 0 )
|
||||||
, m_type( IODevice )
|
, m_type( IODevice )
|
||||||
, m_url( QUrl() )
|
, m_ioDevice ( device )
|
||||||
, m_ioDevice ( 0 )
|
|
||||||
, m_started( false )
|
, m_started( false )
|
||||||
, m_bufferingFinished( false )
|
, m_bufferingFinished( false )
|
||||||
, m_eos( false )
|
, m_eos( false )
|
||||||
@@ -72,7 +68,6 @@ MediaStream::MediaStream( QIODevice* device )
|
|||||||
{
|
{
|
||||||
tDebug() << Q_FUNC_INFO;
|
tDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
m_ioDevice = device;
|
|
||||||
QObject::connect( m_ioDevice, SIGNAL( readChannelFinished() ), this, SLOT( bufferingFinished() ) );
|
QObject::connect( m_ioDevice, SIGNAL( readChannelFinished() ), this, SLOT( bufferingFinished() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,13 +21,10 @@
|
|||||||
#ifndef MEDIASTREAM_H
|
#ifndef MEDIASTREAM_H
|
||||||
#define MEDIASTREAM_H
|
#define MEDIASTREAM_H
|
||||||
|
|
||||||
#include "../Typedefs.h"
|
|
||||||
|
|
||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
#include "Typedefs.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QIODevice>
|
#include <QIODevice>
|
||||||
|
|
||||||
@@ -38,7 +35,7 @@ class DLLEXPORT MediaStream : public QObject
|
|||||||
public:
|
public:
|
||||||
enum MediaType { Unknown = -1, Empty = 0, Url = 1, Stream = 2, IODevice = 3 };
|
enum MediaType { Unknown = -1, Empty = 0, Url = 1, Stream = 2, IODevice = 3 };
|
||||||
|
|
||||||
MediaStream( QObject* parent = 0 );
|
MediaStream( QObject* parent = nullptr );
|
||||||
explicit MediaStream( const QUrl &url );
|
explicit MediaStream( const QUrl &url );
|
||||||
explicit MediaStream( QIODevice* device );
|
explicit MediaStream( QIODevice* device );
|
||||||
virtual ~MediaStream();
|
virtual ~MediaStream();
|
||||||
@@ -74,7 +71,7 @@ protected:
|
|||||||
|
|
||||||
char m_buffer[1048576];
|
char m_buffer[1048576];
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY( MediaStream );
|
Q_DISABLE_COPY( MediaStream )
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MEDIASTREAM_H
|
#endif // MEDIASTREAM_H
|
||||||
|
Reference in New Issue
Block a user