aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2017-06-09 15:33:39 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2017-06-09 15:33:39 +0000
commit5af9af9829605d68195cdb9b278ef39d1e0f0f18 (patch)
tree70756c27a74e46a49a49de2699f11324f2a6ac3e /src
parent9ed6a71047256f66c29b72cf7f66505b1e5e05a6 (diff)
downloadqmmp-5af9af9829605d68195cdb9b278ef39d1e0f0f18.tar.gz
qmmp-5af9af9829605d68195cdb9b278ef39d1e0f0f18.tar.bz2
qmmp-5af9af9829605d68195cdb9b278ef39d1e0f0f18.zip
some api improvements
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7221 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
-rw-r--r--src/qmmp/soundcore.cpp10
-rw-r--r--src/qmmp/soundcore.h12
-rw-r--r--src/qmmp/statehandler.cpp16
-rw-r--r--src/qmmp/statehandler.h18
4 files changed, 28 insertions, 28 deletions
diff --git a/src/qmmp/soundcore.cpp b/src/qmmp/soundcore.cpp
index 2ae5b88c6..4e7335692 100644
--- a/src/qmmp/soundcore.cpp
+++ b/src/qmmp/soundcore.cpp
@@ -222,27 +222,27 @@ bool SoundCore::isMuted() const
return m_muted;
}
-qint64 SoundCore::elapsed()
+qint64 SoundCore::elapsed() const
{
return m_handler->elapsed();
}
-int SoundCore::bitrate()
+int SoundCore::bitrate() const
{
return m_handler->bitrate();
}
-quint32 SoundCore::frequency()
+quint32 SoundCore::frequency() const
{
return m_handler->frequency();
}
-int SoundCore::sampleSize()
+int SoundCore::sampleSize() const
{
return m_handler->sampleSize();
}
-int SoundCore::channels()
+int SoundCore::channels() const
{
return m_handler->channels();
}
diff --git a/src/qmmp/soundcore.h b/src/qmmp/soundcore.h
index 781380f25..d88b49fb0 100644
--- a/src/qmmp/soundcore.h
+++ b/src/qmmp/soundcore.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2006-2013 by Ilya Kotov *
+ * Copyright (C) 2006-2017 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -87,23 +87,23 @@ public:
/*!
* Returns the current time (in milliseconds).
*/
- qint64 elapsed();
+ qint64 elapsed() const;
/*!
* Returns current bitrate (in kbps)
*/
- int bitrate();
+ int bitrate() const;
/*!
* Returns current sample rate (in Hz).
*/
- quint32 frequency();
+ quint32 frequency() const;
/*!
* Returns sample size (in bits).
*/
- int sampleSize();
+ int sampleSize() const;
/*!
* Returns channels number.
*/
- int channels();
+ int channels() const;
/*!
* Returns the current state.
*/
diff --git a/src/qmmp/statehandler.cpp b/src/qmmp/statehandler.cpp
index c327fdc9c..eed6ae7c5 100644
--- a/src/qmmp/statehandler.cpp
+++ b/src/qmmp/statehandler.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008-2012 by Ilya Kotov *
+ * Copyright (C) 2008-2017 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -183,39 +183,39 @@ void StateHandler::dispatchBuffer(int percent)
emit bufferingProgress(percent);
}
-qint64 StateHandler::elapsed()
+qint64 StateHandler::elapsed() const
{
QMutexLocker locker(&m_mutex);
return m_elapsed;
}
-qint64 StateHandler::totalTime()
+qint64 StateHandler::totalTime() const
{
QMutexLocker locker(&m_mutex);
return m_length;
}
-int StateHandler::bitrate()
+int StateHandler::bitrate() const
{
return m_bitrate;
}
-int StateHandler::frequency()
+int StateHandler::frequency() const
{
return m_frequency;
}
-int StateHandler::sampleSize()
+int StateHandler::sampleSize() const
{
return m_precision;
}
-int StateHandler::channels()
+int StateHandler::channels() const
{
return m_channels;
}
-Qmmp::State StateHandler::state()
+Qmmp::State StateHandler::state() const
{
return m_state;
}
diff --git a/src/qmmp/statehandler.h b/src/qmmp/statehandler.h
index faa0ac496..152aae20d 100644
--- a/src/qmmp/statehandler.h
+++ b/src/qmmp/statehandler.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008-2012 by Ilya Kotov *
+ * Copyright (C) 2008-2017 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -77,31 +77,31 @@ public:
/*!
* Returns the current time (in milliseconds).
*/
- qint64 elapsed();
+ qint64 elapsed() const;
/*!
* Returns length in milliseconds
*/
- qint64 totalTime();
+ qint64 totalTime() const;
/*!
* Returns current bitrate (in kbps)
*/
- int bitrate();
+ int bitrate() const;
/*!
* Returns current sample rate (in Hz).
*/
- int frequency();
+ int frequency() const;
/*!
* Returns sample size (in bits).
*/
- int sampleSize();
+ int sampleSize() const;
/*!
* Returns channels number.
*/
- int channels();
+ int channels() const;
/*!
* Returns the current state.
*/
- Qmmp::State state();
+ Qmmp::State state() const;
/*!
* Sends next track request.
*/
@@ -158,7 +158,7 @@ private:
QMap <Qmmp::MetaData, QString> m_metaData;
QHash <QString, QString> m_streamInfo;
Qmmp::State m_state;
- QMutex m_mutex;
+ mutable QMutex m_mutex;
};
#endif