Skip to content

Commit e3117ca

Browse files
committed
fixup! feat: store tracklist as tag comment on recording
1 parent 2bd40a3 commit e3117ca

4 files changed

Lines changed: 26 additions & 26 deletions

File tree

src/encoder/encoderffmpegcore.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,10 @@ void EncoderFfmpegCore::encodeBuffer(const CSAMPLE* samples, const std::size_t b
184184
free(l_fNormalizedSamples);
185185
}
186186

187-
// Originally called from enginebroadcast.cpp to update metadata information
188-
// when streaming, however, this causes pops
189-
//
190-
// Currently this method is used before init() once to save artist, title and album
191-
//
192-
void EncoderFfmpegCore::updateMetaData(const QString& artist,
193-
const QString& title,
194-
const QString& album,
187+
void EncoderFfmpegCore::updateMetaData(const QString&,
188+
const QString&,
189+
const QString&,
195190
std::chrono::seconds) {
196-
qDebug() << "ffmpegencodercore: UpdateMetadata: !" << artist << " - " << title <<
197-
" - " << album;
198191
}
199192

200193
int EncoderFfmpegCore::initEncoder(

src/encoder/encoderffmpegcore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ extern "C" {
1919

2020
#include <QBuffer>
2121
#include <QByteArray>
22+
#include <QFile>
2223
#include <QLibrary>
2324

2425
#include "encoder/encoder.h"

src/encoder/encodermp3.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
11
#include "encoder/encodermp3.h"
22

3-
#include <id3v2header.h>
43
#include <id3v2tag.h>
5-
#include <lame/lame.h>
6-
#include <limits.h>
7-
#include <qbytearrayview.h>
8-
#include <qglobal.h>
9-
#include <qobject.h>
10-
#include <qstringliteral.h>
11-
#include <tbytevector.h>
12-
#include <tstring.h>
13-
14-
#include <QByteArray>
15-
#include <QObject>
16-
#include <QtDebug>
174

185
#include "audio/types.h"
196
#include "encoder/encodercallback.h"
207
#include "encoder/encodermp3settings.h"
21-
#include "util/assert.h"
228

239
namespace {
2410
constexpr size_t kHeaderPadding = 10000;
@@ -189,11 +175,11 @@ void EncoderMp3::flush() {
189175
}
190176
id3Tag.setComment(trackList);
191177

192-
auto id3Buffer = id3Tag.render();
178+
TagLib::ByteVector id3Buffer = id3Tag.render();
193179

194180
m_pCallback->seek(0);
195181
// Write the lame/xing header.
196-
m_pCallback->write((const unsigned char*)id3Buffer.data(),
182+
m_pCallback->write(reinterpret_cast<const unsigned char*>(id3Buffer.data()),
197183
m_bufferOut,
198184
static_cast<int>(id3Buffer.size()),
199185
static_cast<int>(numBytes));

src/preferences/dialog/dlgprefrecorddlg.ui

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<string>Recording Preferences</string>
1515
</property>
1616
<layout class="QGridLayout" name="gridLayout_2">
17+
1718
<item row="0" column="0" colspan="3">
1819
<widget class="QGroupBox" name="groupBoxRecordingsPath">
1920
<property name="title">
@@ -68,6 +69,7 @@
6869
</property>
6970
</widget>
7071
</item>
72+
7173
<item row="1" column="0" colspan="3">
7274
<layout class="QHBoxLayout" name="splittingLayout">
7375
<property name="topMargin">
@@ -95,6 +97,7 @@
9597
<item>
9698
<widget class="QComboBox" name="comboBoxSplitting"/>
9799
</item>
100+
<!--item row="1" column="4" rowspan="4"-->
98101
<item>
99102
<spacer name="horizontalSpacer_split">
100103
<property name="orientation">
@@ -107,13 +110,16 @@
107110
</item>
108111
</layout>
109112
</item>
113+
110114
<item row="2" column="0" colspan="3">
111115
<widget class="QCheckBox" name="CheckBoxRecordCueFile">
112116
<property name="text">
113117
<string>Create a CUE file</string>
114118
</property>
115119
</widget>
116120
</item>
121+
122+
117123
<item row="3" column="0" colspan="3">
118124
<widget class="QCheckBox" name="CheckBoxUseCueFileAnnotation">
119125
<property name="toolTip">
@@ -126,15 +132,18 @@ information from filepaths (i.e. username)</string>
126132
</property>
127133
</widget>
128134
</item>
135+
129136
</layout>
130137
</widget>
131138
</item>
139+
132140
<item row="1" column="0" colspan="3">
133141
<widget class="QGroupBox" name="groupBoxFileformat">
134142
<property name="title">
135143
<string>Output File Format</string>
136144
</property>
137145
<layout class="QGridLayout" name="gridLayout_4">
146+
138147
<item row="1" column="0">
139148
<widget class="QLabel" name="LabelLossless">
140149
<property name="sizePolicy">
@@ -161,6 +170,7 @@ information from filepaths (i.e. username)</string>
161170
</property>
162171
</layout>
163172
</item>
173+
164174
<item row="2" column="0">
165175
<widget class="QLabel" name="LabelLossy">
166176
<property name="text">
@@ -171,13 +181,15 @@ information from filepaths (i.e. username)</string>
171181
<item row="2" column="1" colspan="2">
172182
<layout class="QHBoxLayout" name="LossyEncLayout"/>
173183
</item>
184+
174185
<item row="3" column="0" colspan="3">
175186
<widget class="Line" name="line">
176187
<property name="orientation">
177188
<enum>Qt::Horizontal</enum>
178189
</property>
179190
</widget>
180191
</item>
192+
181193
<item row="4" column="0">
182194
<widget class="QLabel" name="labelOptionGroup">
183195
<property name="minimumSize">
@@ -194,6 +206,7 @@ information from filepaths (i.e. username)</string>
194206
<item row="4" column="1" colspan="2">
195207
<layout class="QHBoxLayout" name="OptionGroupsLayout"/>
196208
</item>
209+
197210
<item row="5" column="0" colspan="3">
198211
<widget class="QWidget" name="qualityGroup">
199212
<layout class="QHBoxLayout" name="qualityHLayout">
@@ -254,6 +267,7 @@ information from filepaths (i.e. username)</string>
254267
</layout>
255268
</widget>
256269
</item>
270+
257271
<item row="6" column="0" colspan="3">
258272
<widget class="QWidget" name="compressionGroup">
259273
<layout class="QHBoxLayout" name="compressionHLayout">
@@ -293,9 +307,11 @@ information from filepaths (i.e. username)</string>
293307
</layout>
294308
</widget>
295309
</item>
310+
296311
</layout>
297312
</widget>
298313
</item>
314+
299315
<item row="2" column="0" colspan="3">
300316
<widget class="QGroupBox" name="groupBoxTags">
301317
<property name="title">
@@ -324,6 +340,7 @@ information from filepaths (i.e. username)</string>
324340
<item row="0" column="1">
325341
<widget class="QLineEdit" name="LineEditTitle"/>
326342
</item>
343+
327344
<item row="1" column="0">
328345
<widget class="QLabel" name="LabelAuthor">
329346
<property name="enabled">
@@ -346,6 +363,7 @@ information from filepaths (i.e. username)</string>
346363
<item row="1" column="1">
347364
<widget class="QLineEdit" name="LineEditAuthor"/>
348365
</item>
366+
349367
<item row="2" column="0">
350368
<widget class="QLabel" name="LabelAlbum">
351369
<property name="enabled">
@@ -381,6 +399,7 @@ information from filepaths (i.e. username)</string>
381399
</layout>
382400
</widget>
383401
</item>
402+
384403
<item row="7" column="1">
385404
<spacer>
386405
<property name="orientation">
@@ -394,6 +413,7 @@ information from filepaths (i.e. username)</string>
394413
</property>
395414
</spacer>
396415
</item>
416+
397417
</layout>
398418
</widget>
399419
<layoutdefault spacing="6" margin="11"/>

0 commit comments

Comments
 (0)