tag: convert to C++

This commit is contained in:
Max Kellermann
2013-07-30 20:11:57 +02:00
parent 6a9ab8bc0e
commit 06f898cc12
105 changed files with 711 additions and 723 deletions

View File

@@ -24,6 +24,8 @@
#include <ao/ao.h>
#include <glib.h>
#include <string.h>
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "ao"

View File

@@ -38,6 +38,7 @@ class ServerSocket;
class HttpdClient;
class Page;
struct Encoder;
struct Tag;
struct HttpdOutput final : private ServerSocket {
struct audio_output base;
@@ -195,7 +196,7 @@ struct HttpdOutput final : private ServerSocket {
bool EncodeAndPlay(const void *chunk, size_t size, GError **error_r);
void SendTag(const struct tag *tag);
void SendTag(const Tag *tag);
private:
virtual void OnAccept(int fd, const sockaddr &address,

View File

@@ -34,6 +34,7 @@
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#ifdef HAVE_LIBWRAP
@@ -484,7 +485,7 @@ httpd_output_pause(struct audio_output *ao)
}
inline void
HttpdOutput::SendTag(const struct tag *tag)
HttpdOutput::SendTag(const Tag *tag)
{
assert(tag != NULL);
@@ -523,7 +524,7 @@ HttpdOutput::SendTag(const struct tag *tag)
TAG_NUM_OF_ITEM_TYPES
};
metadata = icy_server_metadata_page(tag, &types[0]);
metadata = icy_server_metadata_page(*tag, &types[0]);
if (metadata != NULL) {
const ScopeLock protect(mutex);
for (auto &client : clients)
@@ -533,7 +534,7 @@ HttpdOutput::SendTag(const struct tag *tag)
}
static void
httpd_output_tag(struct audio_output *ao, const struct tag *tag)
httpd_output_tag(struct audio_output *ao, const Tag *tag)
{
HttpdOutput *httpd = Cast(ao);

View File

@@ -29,6 +29,7 @@
#include <jack/ringbuffer.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

View File

@@ -329,7 +329,7 @@ roar_tag_convert(enum tag_type type, bool *is_uuid)
}
static void
roar_send_tag(struct audio_output *ao, const struct tag *meta)
roar_send_tag(struct audio_output *ao, const Tag *meta)
{
RoarOutput *self = (RoarOutput *)ao;

View File

@@ -29,6 +29,7 @@
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#undef G_LOG_DOMAIN
@@ -482,7 +483,7 @@ my_shout_pause(struct audio_output *ao)
}
static void
shout_tag_to_metadata(const struct tag *tag, char *dest, size_t size)
shout_tag_to_metadata(const Tag *tag, char *dest, size_t size)
{
char artist[size];
char title[size];
@@ -508,7 +509,7 @@ shout_tag_to_metadata(const struct tag *tag, char *dest, size_t size)
}
static void my_shout_set_tag(struct audio_output *ao,
const struct tag *tag)
const Tag *tag)
{
ShoutOutput *sd = (ShoutOutput *)ao;
GError *error = nullptr;