mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-24 06:26:15 +02:00
Modernize: replace typedef with using
This commit is contained in:
parent
f388449c0a
commit
f1e672d375
7 changed files with 12 additions and 14 deletions
|
@ -27,7 +27,7 @@ struct DNSServiceRefDeleter
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::unique_ptr<DNSServiceRef, DNSServiceRefDeleter> DNSServiceHandle;
|
using DNSServiceHandle = std::unique_ptr<DNSServiceRef, DNSServiceRefDeleter>;
|
||||||
|
|
||||||
string BonjourGetError(DNSServiceErrorType error)
|
string BonjourGetError(DNSServiceErrorType error)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,10 +28,10 @@ public:
|
||||||
|
|
||||||
#if defined(HAS_AVAHI)
|
#if defined(HAS_AVAHI)
|
||||||
#include "browse_avahi.hpp"
|
#include "browse_avahi.hpp"
|
||||||
typedef BrowseAvahi BrowseZeroConf;
|
using BrowseZeroConf = BrowseAvahi;
|
||||||
#elif defined(HAS_BONJOUR)
|
#elif defined(HAS_BONJOUR)
|
||||||
#include "browse_bonjour.hpp"
|
#include "browse_bonjour.hpp"
|
||||||
typedef BrowseBonjour BrowseZeroConf;
|
using BrowseZeroConf = BrowseBonjour;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -24,12 +24,10 @@
|
||||||
|
|
||||||
#include "player.hpp"
|
#include "player.hpp"
|
||||||
|
|
||||||
typedef int (*AndroidAudioCallback)(short* buffer, int num_samples);
|
|
||||||
|
|
||||||
|
/// Android Oboe Audio Player
|
||||||
/// OpenSL Audio Player
|
|
||||||
/**
|
/**
|
||||||
* Player implementation for Oboe
|
* Player implementation for Android Oboe
|
||||||
*/
|
*/
|
||||||
class OboePlayer : public Player, public oboe::AudioStreamCallback
|
class OboePlayer : public Player, public oboe::AudioStreamCallback
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,8 +35,8 @@ using json = nlohmann::json;
|
||||||
struct ClientInfo;
|
struct ClientInfo;
|
||||||
struct Group;
|
struct Group;
|
||||||
|
|
||||||
typedef std::shared_ptr<ClientInfo> ClientInfoPtr;
|
using ClientInfoPtr = std::shared_ptr<ClientInfo>;
|
||||||
typedef std::shared_ptr<Group> GroupPtr;
|
using GroupPtr = std::shared_ptr<Group>;
|
||||||
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
|
@ -35,10 +35,10 @@ protected:
|
||||||
|
|
||||||
#if defined(HAS_AVAHI)
|
#if defined(HAS_AVAHI)
|
||||||
#include "publish_avahi.hpp"
|
#include "publish_avahi.hpp"
|
||||||
typedef PublishAvahi PublishZeroConf;
|
using PublishZeroConf = PublishAvahi;
|
||||||
#elif defined(HAS_BONJOUR)
|
#elif defined(HAS_BONJOUR)
|
||||||
#include "publish_bonjour.hpp"
|
#include "publish_bonjour.hpp"
|
||||||
typedef PublishBonjour PublishZeroConf;
|
using PublishZeroConf = PublishBonjour;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -79,8 +79,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implement the ConstBufferSequence requirements.
|
// Implement the ConstBufferSequence requirements.
|
||||||
typedef boost::asio::const_buffer value_type;
|
using value_type = boost::asio::const_buffer;
|
||||||
typedef const boost::asio::const_buffer* const_iterator;
|
using const_iterator = const boost::asio::const_buffer*;
|
||||||
const boost::asio::const_buffer* begin() const
|
const boost::asio::const_buffer* begin() const
|
||||||
{
|
{
|
||||||
return &buffer_;
|
return &buffer_;
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace
|
||||||
{
|
{
|
||||||
string hex2str(string input)
|
string hex2str(string input)
|
||||||
{
|
{
|
||||||
typedef unsigned char byte;
|
using byte = unsigned char;
|
||||||
unsigned long x = strtoul(input.c_str(), nullptr, 16);
|
unsigned long x = strtoul(input.c_str(), nullptr, 16);
|
||||||
byte a[] = {byte(x >> 24), byte(x >> 16), byte(x >> 8), byte(x), 0};
|
byte a[] = {byte(x >> 24), byte(x >> 16), byte(x >> 8), byte(x), 0};
|
||||||
return string((char*)a);
|
return string((char*)a);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue