#include "pbd/openuri.h"
#include "pbd/basename.h"
+
#include "gtkmm2ext/utils.h"
-#include "gtkmm2ext/utils.h"
-#include "canvas/utils.h"
-#include "canvas/colors.h"
+#include "gtkmm2ext/colors.h"
#include "audiographer/general/analyser.h"
SoundFileInfo info;
std::string errmsg;
- framecnt_t file_length = 0;
- framecnt_t sample_rate = 0;
- framecnt_t start_off = 0;
+ samplecnt_t file_length = 0;
+ samplecnt_t sample_rate = 0;
+ samplecnt_t start_off = 0;
unsigned int channels = 0;
std::string file_fmt;
/* File Info Table */
- framecnt_t const nfr = _session ? _session->nominal_frame_rate () : 25;
+ samplecnt_t const nfr = _session ? _session->nominal_sample_rate () : 25;
double src_coef = (double) nfr / info.samplerate;
l = manage (new Label (_("Format:"), ALIGN_END));
clock->set (info.timecode * src_coef + 0.5, true);
t->attach (*clock, 3, 4, 3, 4);
} else if (with_file) {
- l = manage (new Label (_("Error:"), ALIGN_END));
- t->attach (*l, 0, 1, 1, 2);
- l = manage (new Label (errmsg, ALIGN_START));
- t->attach (*l, 1, 4, 1, 2);
+ with_file = false;
+ /* Note: errmsg can have size = 1, and contain "\0\0" */
+ if (!errmsg.empty() && 0 != strlen(errmsg.c_str())) {
+ l = manage (new Label (_("Error:"), ALIGN_END));
+ t->attach (*l, 0, 1, 1, 2);
+ l = manage (new Label (errmsg, ALIGN_START));
+ t->attach (*l, 1, 4, 1, 2);
+ }
}
int w, h;
rint ((g + 59.0) * 10.0 - h * .5), 5,
h + 2, w + 2, 4);
const float pk = (g + 59.0) / 54.0;
- ArdourCanvas::Color c = ArdourCanvas::hsva_to_color (252 - 260 * pk, .9, .3 + pk * .4, .6);
- ArdourCanvas::set_source_rgba (cr, c);
+ Gtkmm2ext::Color c = Gtkmm2ext::hsva_to_color (252 - 260 * pk, .9, .3 + pk * .4, .6);
+ Gtkmm2ext::set_source_rgba (cr, c);
cr->fill ();
cr->save ();
for (size_t x = 0 ; x < width; ++x) {
for (size_t y = 0 ; y < height; ++y) {
const float pk = p->spectrum[x][y];
- ArdourCanvas::Color c = ArdourCanvas::hsva_to_color (252 - 260 * pk, .9, sqrt(pk));
- ArdourCanvas::set_source_rgba (cr, c);
+ Gtkmm2ext::Color c = Gtkmm2ext::hsva_to_color (252 - 260 * pk, .9, sqrt(pk));
+ Gtkmm2ext::set_source_rgba (cr, c);
cr->rectangle (m_l + x - .5, y - .5, 1, 1);
cr->fill ();
}
for (size_t y = 0 ; y < innerheight - 2; ++y) {
const float pk = 1.0 - (float) y / innerheight;
- ArdourCanvas::Color c = ArdourCanvas::hsva_to_color (252 - 260 * pk, .9, sqrt(pk));
- ArdourCanvas::set_source_rgba (cr, c);
+ Gtkmm2ext::Color c = Gtkmm2ext::hsva_to_color (252 - 260 * pk, .9, sqrt(pk));
+ Gtkmm2ext::set_source_rgba (cr, c);
cr->rectangle (2, innertop + y + .5, m_r - 4 - anw, 1);
cr->fill ();
}
SourceFactory::createExternal (DataType::AUDIO, *_session,
path, n,
Source::Flag (ARDOUR::AudioFileSource::NoPeakFile), false));
- if (afs->sample_rate() != _session->nominal_frame_rate()) {
+ if (afs->sample_rate() != _session->nominal_sample_rate()) {
boost::shared_ptr<SrcFileSource> sfs (new SrcFileSource(*_session, afs, ARDOUR::SrcGood));
srclist.push_back(sfs);
} else {
}
void
-ExportReport::audition_progress (framecnt_t pos, framecnt_t len)
+ExportReport::audition_progress (samplecnt_t pos, samplecnt_t len)
{
if (_audition_num == _page_num && timeline.find (_audition_num) != timeline.end ()) {
const float p = (float)pos / len;
// >= -1dBTP (coeff >= .89125, libs/vamp-plugins/TruePeak.cpp)
cr->set_source_rgba (1.0, 0.7, 0, 0.7);
- for (std::set<framepos_t>::const_iterator i = p->truepeakpos[c].begin (); i != p->truepeakpos[c].end (); ++i) {
+ for (std::set<samplepos_t>::const_iterator i = p->truepeakpos[c].begin (); i != p->truepeakpos[c].end (); ++i) {
cr->move_to (m_l + (*i) - .5, clip_top);
cr->line_to (m_l + (*i) - .5, clip_bot);
cr->stroke ();