aboutsummaryrefslogtreecommitdiffstats
path: root/src/MusicChunk.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/MusicChunk.hxx')
-rw-r--r--src/MusicChunk.hxx26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/MusicChunk.hxx b/src/MusicChunk.hxx
index ecd57090b..805112d02 100644
--- a/src/MusicChunk.hxx
+++ b/src/MusicChunk.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2013 The Music Player Daemon Project
+ * Copyright (C) 2003-2014 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -20,6 +20,7 @@
#ifndef MPD_MUSIC_CHUNK_HXX
#define MPD_MUSIC_CHUNK_HXX
+#include "Chrono.hxx"
#include "ReplayGainInfo.hxx"
#include "util/WritableBuffer.hxx"
@@ -39,15 +40,15 @@ struct Tag;
* A chunk of music data. Its format is defined by the
* MusicPipe::Push() caller.
*/
-struct music_chunk {
+struct MusicChunk {
/** the next chunk in a linked list */
- struct music_chunk *next;
+ MusicChunk *next;
/**
* An optional chunk which should be mixed into this chunk.
* This is used for cross-fading.
*/
- struct music_chunk *other;
+ MusicChunk *other;
/**
* The current mix ratio for cross-fading: 1.0 means play 100%
@@ -62,7 +63,7 @@ struct music_chunk {
uint16_t bit_rate;
/** the time stamp within the song */
- float times;
+ SignedSongTime time;
/**
* An optional tag associated with this chunk (and the
@@ -92,13 +93,13 @@ struct music_chunk {
AudioFormat audio_format;
#endif
- music_chunk()
+ MusicChunk()
:other(nullptr),
length(0),
tag(nullptr),
replay_gain_serial(0) {}
- ~music_chunk();
+ ~MusicChunk();
bool IsEmpty() const {
return length == 0 && tag == nullptr;
@@ -116,9 +117,9 @@ struct music_chunk {
/**
* Prepares appending to the music chunk. Returns a buffer
* where you may write into. After you are finished, call
- * music_chunk_expand().
+ * Expand().
*
- * @param chunk the music_chunk object
+ * @param chunk the MusicChunk object
* @param audio_format the audio format for the appended data;
* must stay the same for the life cycle of this chunk
* @param data_time the time within the song
@@ -128,13 +129,14 @@ struct music_chunk {
* @return a writable buffer, or nullptr if the chunk is full
*/
WritableBuffer<void> Write(AudioFormat af,
- float data_time, uint16_t bit_rate);
+ SongTime data_time,
+ uint16_t bit_rate);
/**
* Increases the length of the chunk after the caller has written to
- * the buffer returned by music_chunk_write().
+ * the buffer returned by Write().
*
- * @param chunk the music_chunk object
+ * @param chunk the MusicChunk object
* @param audio_format the audio format for the appended data; must
* stay the same for the life cycle of this chunk
* @param length the number of bytes which were appended